-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfig_nginx_default.cfg
40 lines (34 loc) · 1.29 KB
/
config_nginx_default.cfg
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
# Template for nginx configuration sites-available/default
# Check if the config is valid using: nginx -t YourConfig.cfg
# To use SSL Let's Encrypt, install certbot and run:
# $sudo certbot --nginx -d webpage.com www.webpage.com
# $sudo certbot renew
# $sudo nano /etc/nginx/sites-available/default
# Server config
server {
listen 443 ssl;
server_name webpage.com;
# The lines below will be inserted by certbot
#ssl on;
#ssl_certificate /etc/letsencrypt/live/webpage.com/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/webpage.com/privkey.pem;
location / {
root /home/user/nim/nimwc/public;
if ($request_uri ~* ".(ico|css|js|gif|jpeg|jpg|png|svg|bmp|webp)$") {
expires max;
access_log off;
add_header Pragma public;
add_header Cache-Control "public";
}
server_tokens off;
add_header X-Frame-Options SAMEORIGIN;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
proxy_pass http://127.0.0.1:7000;
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;
}
}