-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
47 lines (41 loc) Β· 1.48 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
server {
listen 80;
server_name rupantor.aknibir.dev;
# REDIRECTINGt HTTP TO HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name rupantor.aknibir.dev;
# SSL CONFIGURATION
ssl_certificate /etc/letsencrypt/live/rupantor.aknibir.dev/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/rupantor.aknibir.dev/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384';
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
# REVERSE PROXY CONFIGURATION
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
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_redirect off;
}
# ADDITIONAL SECURITY CONFIGURATION
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
# ERROR HANDELING CONFIGURATION
error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}