We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cfe536 commit a34814aCopy full SHA for a34814a
1 file changed
nginx.conf
@@ -61,6 +61,19 @@ http {
61
access_log /dev/stdout main;
62
error_log /dev/stderr warn;
63
64
+ # Canonical-host redirect: www.codecrispi.es → codecrispi.es (apex).
65
+ # Upstream proxy terminates TLS; we only see plain HTTP here, but the
66
+ # Host header survives so we can detect www and 301 it.
67
+ # Header sent uses https:// because the original request was HTTPS at
68
+ # the proxy boundary. If an upstream sets X-Forwarded-Proto, we honor
69
+ # that; otherwise default to https (production reality).
70
+ server {
71
+ listen 80;
72
+ listen [::]:80;
73
+ server_name www.codecrispi.es;
74
+ return 301 https://codecrispi.es$request_uri;
75
+ }
76
+
77
server {
78
listen 80 default_server;
79
listen [::]:80 default_server;
0 commit comments