-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjohnjago.com.nginx
48 lines (38 loc) · 1.31 KB
/
johnjago.com.nginx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Redirect www to non-www.
server {
server_name www.johnjago.com;
listen *:80;
listen [::]:80;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/johnjago.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/johnjago.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
return 301 https://johnjago.com$request_uri;
}
# Redirect http to https.
server {
server_name johnjago.com;
listen *:80;
listen [::]:80;
return 301 https://johnjago.com$request_uri;
}
server {
server_name johnjago.com;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/johnjago.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/johnjago.com/privkey.pem;
root /home/john/johnjago.com;
index index.html;
error_page 404 /404.html;
rewrite ^/blog/(?!$|index\.html)(.*)$ /$1 permanent;
rewrite ^/work-journal[/]?$ /2024-bootstrapping-journal/ permanent;
location / {
try_files $uri $uri/ =404;
}
location ~* \.(png|.jpg|.jpeg|css|js|woff)$ {
expires 1y;
}
}