[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;
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;

View file

@ -3,11 +3,11 @@ server {
listen [::]:80 default_server;
location / {
rewrite ^ https://$http_host/yunohost/admin permanent;
return 302 https://$http_host/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;";
location / {
rewrite ^ https://$http_host/yunohost/admin permanent;
return 302 https://$http_host/yunohost/admin;
}
# Block crawlers bot