-
Notifications
You must be signed in to change notification settings - Fork 6
/
nginx.conf
60 lines (48 loc) · 1.54 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
server {
listen 443 ssl; # ipv4
#listen [::]:443 ssl; # ipv6
root <nodeshot_dir>/public_html;
index index.html index.htm;
# error log
access_log <nodeshot_dir>/log/nginx.access.log;
error_log <nodeshot_dir>/log/nginx.error.log error;
# Make site accessible from hostanme
# change this according to your domain/hostanme
server_name <server_name>;
# set client body size #
client_max_body_size 5M;
ssl on;
ssl_certificate ssl/server.crt;
ssl_certificate_key ssl/server.key;
# optimizations
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5;
add_header Strict-Transport-Security "max-age=31536000";
add_header X-Content-Type-Options nosniff;
location @uwsgi {
uwsgi_pass 127.0.0.1:3031;
include uwsgi_params;
uwsgi_param HTTP_X_FORWARDED_PROTO https;
}
location / {
try_files <nodeshot_dir>/public_html/maintenance.html $uri @uwsgi;
}
location /static {
alias <nodeshot_dir>/<project_name>/static/;
}
location /media {
alias <nodeshot_dir>/<project_name>/media/;
}
}
server {
listen 80; # ipv4
#listen [::]:80; # ipv6
# Make site accessible from hostanme on port 80
# change this according to your domain/hostanme
server_name <server_name>;
# redirect all requests to https
return 301 https://$host$request_uri;
}