[fix] Cleaner Nginx redirection rules. Use permanent only when paths match.

This commit is contained in:
opi 2016-03-02 12:14:34 +01:00 committed by Jérôme Lebleu
parent 204e3ed3ff
commit 7729d91e78
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ server {
include conf.d/{{ domain }}.d/*.conf; include conf.d/{{ domain }}.d/*.conf;
location /yunohost/admin { location /yunohost/admin {
rewrite ^ https://$http_host$request_uri? permanent; return 301 https://$http_host$request_uri;
} }
access_log /var/log/nginx/{{ domain }}-access.log; access_log /var/log/nginx/{{ domain }}-access.log;

View file

@ -3,11 +3,11 @@ server {
listen [::]:80 default_server; listen [::]:80 default_server;
location / { location / {
rewrite ^ https://$http_host/yunohost/admin permanent; return 302 https://$http_host/yunohost/admin;
} }
location /yunohost/admin { location /yunohost/admin {
rewrite ^ https://$http_host$request_uri? permanent; return 301 https://$http_host$request_uri;
} }
} }
@ -26,7 +26,7 @@ server {
add_header Strict-Transport-Security "max-age=31536000;"; add_header Strict-Transport-Security "max-age=31536000;";
location / { location / {
rewrite ^ https://$http_host/yunohost/admin permanent; return 302 https://$http_host/yunohost/admin;
} }
# Block crawlers bot # Block crawlers bot