Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Proxy http 01 validation

Timofey Koolin edited this page Mar 20, 2018 · 4 revisions

In the solutions base server (apache, nginx and etc) have to:

  1. listen port 80 for handle usual traffic (from internet and from local lets-proxy).
  2. Proxy requests /.well-known/acme-challenge/ to lets-proxy: http://127.0.0.1:4443/.well-known/acme-challenge/
  3. Free port 443 (lets-proxy will listen port 443).

Apache

Add to global httpd.conf lines:

# Lets encrypt proxy http-01 validation
ProxyPass /.well-known/acme-challenge/ http://127.0.0.1:4443/.well-known/acme-challenge/

Nginx

Add to every server:

location ^~ /.well-known/acme-challenge/ {
  proxy_pass       http://127.0.0.1:4443;
  proxy_set_header Host      $host;
  proxy_set_header X-Real-IP $remote_addr;
}

IIS 7.0 and higher

Install: Application Request Routing and URL Rewrite modules.

web.config

<configuration>
<!-- ... -->
<system.webServer>
    <!-- ... -->
    <rewrite>
        <rules>
            <rule name="lets encrypt http-01 validation" patternSyntax="Wildcard" stopProcessing="true">
                <match url=".well-known/acme-challenge/*" />
                <action type="Rewrite" url="http://127.0.0.1:4443{REQUEST_URI}" appendQueryString="false" />
            </rule>
        </rules>
    </rewrite>
    <!-- ... -->
</system.webServer>
<!-- ... -->
</configuration>

English

In IIS management console:

  1. Enter in Application Request Routing Cache
  2. Link "Server Proxy Settings" at right.
  3. Check "Enable proxy"
  4. Apply

Next: URL rewriter settings (global for server):

  1. Add rule(s) at right
  2. Create "blank rule"
  3. Set name "lets encrypt http-01 validation" (or something good understand for you, you can't change name of rule in feature).
  4. Match url: using Wildcards.
  5. Match url: pattern: .well-known/acme-challenge/*
  6. Action: Rewrite
  7. Rewrite URL: http://127.0.0.1:4443{REQUEST_URI}
  8. Uncheck "Append query string".
  9. Checl "Stop processing of subsequent rules".
  10. Apply

Russian

В консоли настройки IIS (глобальной - для всего сервера):

  1. Зайти в Application Request Routing Cache
  2. Справа в разделе Proxy ссылка Server Proxy Settings
  3. Поставить вверху галочку "Enable proxy", применить.

Дальше в настройках "Переопределение URL-адресов" (так же глобально для всего сервера):

  1. Справа "Добавить правила"
  2. Название: "lets encrypt http-01 validation" (имя само по себе роли не играет, но изменить его потом нельзя и лучше делать понятным).
  3. Соответствует url-адресу: использование - подстановочные знаки
  4. Соответствует url-адресу: шаблон .well-known/acme-challenge/*
  5. Действие: Переопределение
  6. URL-адрес переопределение: http://127.0.0.1:4443{REQUEST_URI}
  7. Снять галочку "Добавить строку запроса"
  8. Поставить галочку "Остановить обработку последующих правил".
  9. Применить
Clone this wiki locally