server { if ($host = clarissariviere.fr) { return 301 https://"www.clarissariviere.fr"$request_uri; } # managed by Certbot if ($host = clarissariviere.com) { return 301 https://"www.clarissariviere.com"$request_uri; } # 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; error_log /var/log/nginx/clarissa_error.log; #gzip_static off; server_name clarissariviere.com clarissariviere.fr www.clarissariviere.fr www.clarissariviere.com; add_header 'Content-Security-Policy' 'upgrade-insecure-requests'; add_header Link " rel=\"canonical\", rel=\"alternate\" hreflang=\"fr\""; proxy_cache STATIC; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. #try_files $uri $uri/ =404; proxy_set_header Accept-Encoding ""; proxy_pass http://gouters.canalblog.com/; #add_header Link ""; #proxy_redirect off; #proxy_set_header Host $host; #proxy_buffering on; #proxy_cache STATIC; proxy_cache_key $scheme://$host$uri$is_args$query_string; proxy_cache_valid 200 10m; proxy_cache_lock on; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; proxy_ignore_headers X-Accel-Expires Expires Cache-Control; #proxy_ssl_verify off; #proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #proxy_set_header X-Forwarded-Proto $scheme; sub_filter 'canonical' "$link"; sub_filter 'gouters.canalblog.com' "$host"; sub_filter '' ''; sub_filter '