Skip to content

Commit

Permalink
fix: scope redirects to location /
Browse files Browse the repository at this point in the history
This allows other location blocks to work correctly, including the one from the letsencrypt plugin.

Refs dokku/dokku-letsencrypt#228
  • Loading branch information
josegonzalez committed Apr 13, 2021
1 parent b54c616 commit 89d1cf7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions templates/nginx.conf.sigil
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ server {
access_log off;

include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf;
return {{ $.REDIR_CODE }} $scheme://{{ $.DEST_DOMAIN }}$request_uri;
location / {
return {{ $.REDIR_CODE }} $scheme://{{ $.DEST_DOMAIN }}$request_uri;
}
}
{{ else if eq $scheme "https"}}
server {
Expand All @@ -24,6 +26,8 @@ server {
ssl_certificate_key {{ $.APP_SSL_PATH }}/server.key;

include {{ $.DOKKU_ROOT }}/{{ $.APP }}/nginx.conf.d/*.conf;
return {{ $.REDIR_CODE }} $scheme://{{ $.DEST_DOMAIN }}$request_uri;
location / {
return {{ $.REDIR_CODE }} $scheme://{{ $.DEST_DOMAIN }}$request_uri;
}
}
{{ end }}{{ end }}

0 comments on commit 89d1cf7

Please sign in to comment.