Skip to content

Commit 998d2bb

Browse files
committed
Configure www. redirect
1 parent 47da98b commit 998d2bb

File tree

1 file changed

+38
-10
lines changed

1 file changed

+38
-10
lines changed

kanjuro/nginx/noeldemartin.com.conf

+38-10
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ map $http_upgrade $connection_upgrade {
55

66
proxy_cache_path /var/cache/nginx-noeldemartin levels=1:2 keys_zone=CACHE-NOELDEMARTIN:10m inactive=7d max_size=1g;
77

8-
server {
9-
listen 80;
10-
listen [::]:80;
11-
server_name noeldemartin.com;
12-
server_tokens off;
13-
root /var/www/noeldemartin/public;
14-
location /.well-known/acme-challenge/ { allow all; }
15-
location / { return 301 https://$host$request_uri; }
16-
}
17-
188
server {
199
listen 443 ssl http2;
2010
listen [::]:443 ssl http2;
@@ -85,6 +75,44 @@ server {
8575

8676
}
8777

78+
## http:// redirect
79+
80+
server {
81+
listen 80;
82+
listen [::]:80;
83+
server_name noeldemartin.com;
84+
server_tokens off;
85+
root /var/www/noeldemartin/public;
86+
location /.well-known/acme-challenge/ { allow all; }
87+
location / { return 301 https://$host$request_uri; }
88+
}
89+
90+
## www. redirect
91+
92+
server {
93+
listen 80;
94+
listen [::]:80;
95+
server_name www.noeldemartin.com;
96+
server_tokens off;
97+
location / { return 301 https://noeldemartin.com$request_uri; }
98+
}
99+
100+
server {
101+
listen 443 ssl;
102+
listen [::]:443 ssl;
103+
server_name www.noeldemartin.com;
104+
server_tokens off;
105+
106+
ssl_certificate /etc/letsencrypt/live/www.noeldemartin.com/fullchain.pem;
107+
ssl_certificate_key /etc/letsencrypt/live/www.noeldemartin.com/privkey.pem;
108+
ssl_protocols TLSv1.2;
109+
ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA;
110+
ssl_prefer_server_ciphers on;
111+
ssl_session_cache shared:SSL:10m;
112+
113+
location / { return 301 https://noeldemartin.com$request_uri; }
114+
}
115+
88116
## learn.noeldemartin.social redirect
89117

90118
server {

0 commit comments

Comments
 (0)