forked from kristjanmik/kjosturett-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
72 lines (57 loc) · 1.84 KB
/
nginx.conf
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
## http://kjosturett.is redirects to https://kjosturett.is
server {
listen 80;
listen [::]:80;
server_name kjosturett.is www.kjosturett.is;
include /etc/nginx/snippets/letsencrypt.conf;
location / {
return 301 https://kjosturett.is$request_uri;
}
}
## https://www.kjosturett.is redirects to https://kjosturett.is
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.kjosturett.is;
ssl_certificate /etc/letsencrypt/live/www.kjosturett.is/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.kjosturett.is/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/www.kjosturett.is/fullchain.pem;
include /etc/nginx/snippets/ssl.conf;
location / {
return 301 https://kjosturett.is$request_uri;
}
}
## Serves https://kjosturett.is
server {
server_name kjosturett.is;
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server ipv6only=on;
ssl_certificate /etc/letsencrypt/live/www.kjosturett.is/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.kjosturett.is/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/www.kjosturett.is/fullchain.pem;
include /etc/nginx/snippets/ssl.conf;
location / {
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;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:5000;
proxy_redirect off;
}
error_page 502 /502.html;
location = /502.html {
root /usr/share/nginx/html;
internal;
}
error_page 503 /503.html;
location = /503.html {
root /usr/share/nginx/html;
internal;
}
error_page 504 /504.html;
location = /504.html {
root /usr/share/nginx/html;
internal;
}
}