add redirect www.clarissariviere.fr

This commit is contained in:
Valentin CZERYBA 2023-06-15 21:20:12 +02:00
parent 42cd55258c
commit cbb57b8493

View File

@ -1,16 +1,15 @@
server { server {
if ($host = clarissariviere.fr) { if ($host = clarissariviere.fr) {
return 301 https://"www.clarissariviere.fr"$request_uri; return 301 "https://www.clarissariviere.com$request_uri";
} # managed by Certbot
if ($host = www.clarissariviere.fr) {
return 301 "https://www.clarissariviere.com$request_uri";
} # managed by Certbot } # managed by Certbot
if ($host = clarissariviere.com) { if ($host = clarissariviere.com) {
return 301 https://"www.clarissariviere.com"$request_uri; return 301 "https://www.clarissariviere.com$request_uri";
} # managed by Certbot } # managed by Certbot
set $link 'canonical';
if ($host = www.clarissariviere.fr) {
set $link "alternate\" hreflang=\"fr";
}
access_log /var/log/nginx/clarissa_access.log main; access_log /var/log/nginx/clarissa_access.log main;
error_log /var/log/nginx/clarissa_error.log; error_log /var/log/nginx/clarissa_error.log;
#gzip_static off; #gzip_static off;
@ -18,9 +17,9 @@ server {
add_header 'Content-Security-Policy' 'upgrade-insecure-requests'; add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
#add_header Link "<https://www.clarissariviere.com$request_uri;> rel=\"canonical\", <https://www.clarissariviere.fr$request_uri;> rel=\"alternate\" hreflang=\"fr\""; #add_header Link "<https://www.clarissariviere.com$request_uri;> rel=\"canonical\", <https://www.clarissariviere.fr$request_uri;> rel=\"alternate\" hreflang=\"fr\"";
proxy_cache STATIC; proxy_cache STATIC;
set $header "<https://www.clarissariviere.com$request_uri;> rel=\"canonical\", <https://www.clarissariviere.fr$request_uri;> rel=\"alternate\" hreflang=\"fr\""; set $header "<https://$host$request_uri;> rel=\"canonical\"";
if ($request_uri ~ "/tag/") { if ($request_uri ~ "/tag/") {
set $header "<https://www.clarissariviere.com;> rel=\"canonical\", <https://www.clarissariviere.fr;> rel=\"alternate\" hreflang=\"fr\""; set $header "<https://$host;> rel=\"canonical\"";
set $link ""; set $link "";
} }
@ -46,7 +45,6 @@ server {
#proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto $scheme; #proxy_set_header X-Forwarded-Proto $scheme;
sub_filter 'canonical' "$link";
sub_filter 'http://gouters.canalblog.com' "https://$host"; sub_filter 'http://gouters.canalblog.com' "https://$host";
sub_filter '<meta name="generator" content="CanalBlog - https://www.canalblog.com" />' ''; sub_filter '<meta name="generator" content="CanalBlog - https://www.canalblog.com" />' '';
sub_filter '<meta name="Keywords" content="' '<meta name="Keywords" content="clarissa, riviere, '; sub_filter '<meta name="Keywords" content="' '<meta name="Keywords" content="clarissa, riviere, ';