Skip to content

Commit 23112c3

Browse files
author
Judah MW
committed
nginx: Added ACME redirect to main domain based on alias domain fix
This allows sites using redirect=proxy to still generate ACME certificates by not passing the acme requests through to the proxy. We should also consider using this for other features available such as own error documents, SSI and custom directives.
1 parent 221728d commit 23112c3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

server/conf/nginx_vhost.conf.master

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ server {
6969
<tmpl_if name='exclude_own_hostname'>if ($http_host != "<tmpl_var name='exclude_own_hostname'>") { </tmpl_if>rewrite ^<tmpl_var name='rewrite_exclude'>(.*)$ <tmpl_var name='rewrite_target'>$2 <tmpl_var name='rewrite_type'>;<tmpl_if name='exclude_own_hostname'> }</tmpl_if>
7070
</tmpl_if>
7171
<tmpl_if name='use_proxy'>
72+
## no proxy for acme-challenge
73+
location ^~ /.well-known/acme-challenge/ {
74+
access_log off;
75+
log_not_found off;
76+
root /usr/local/ispconfig/interface/acme/;
77+
autoindex off;
78+
index index.html;
79+
try_files $uri $uri/ =404;
80+
}
81+
7282
location / {
7383
proxy_pass <tmpl_var name='rewrite_target'>;
7484
<tmpl_if name='rewrite_subdir'>rewrite ^/<tmpl_var name='rewrite_subdir'>(.*) /$1;</tmpl_if>

0 commit comments

Comments
 (0)