This repository has been archived by the owner on Oct 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
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:
- listen port 80 for handle usual traffic (from internet and from local lets-proxy).
- Proxy requests /.well-known/acme-challenge/ to lets-proxy: http://127.0.0.1:4443/.well-known/acme-challenge/
- Free port 443 (lets-proxy will listen port 443).
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/
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;
}
Install: Application Request Routing and URL Rewrite modules.
<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>
In IIS management console:
- Enter in Application Request Routing Cache
- Link "Server Proxy Settings" at right.
- Check "Enable proxy"
- Apply
Next: URL rewriter settings (global for server):
- Add rule(s) at right
- Create "blank rule"
- Set name "lets encrypt http-01 validation" (or something good understand for you, you can't change name of rule in feature).
- Match url: using Wildcards.
- Match url: pattern: .well-known/acme-challenge/*
- Action: Rewrite
- Rewrite URL: http://127.0.0.1:4443{REQUEST_URI}
- Uncheck "Append query string".
- Checl "Stop processing of subsequent rules".
- Apply
В консоли настройки IIS (глобальной - для всего сервера):
- Зайти в Application Request Routing Cache
- Справа в разделе Proxy ссылка Server Proxy Settings
- Поставить вверху галочку "Enable proxy", применить.
Дальше в настройках "Переопределение URL-адресов" (так же глобально для всего сервера):
- Справа "Добавить правила"
- Название: "lets encrypt http-01 validation" (имя само по себе роли не играет, но изменить его потом нельзя и лучше делать понятным).
- Соответствует url-адресу: использование - подстановочные знаки
- Соответствует url-адресу: шаблон .well-known/acme-challenge/*
- Действие: Переопределение
- URL-адрес переопределение: http://127.0.0.1:4443{REQUEST_URI}
- Снять галочку "Добавить строку запроса"
- Поставить галочку "Остановить обработку последующих правил".
- Применить