-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
66 lines (64 loc) · 1.94 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
server {
listen 443 ssl http2;
server_name www.awesome-game.me;
ssl_certificate /etc/letsencrypt/live/www.awesome-game.me/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.awesome-game.me/privkey.pem;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
location / {
include proxy_params;
proxy_pass http://127.0.0.1:5000;
}
location /static/ {
root /home/deploy/awesome-game/awesome_game/;
index index.html;
}
location /games/ {
root /home/deploy/awesome-game/awesome_game/;
deny all; # deny by default
location ~ "\.(js|gif|jpg)$" {
allow all;
}
}
location = /favicon.ico {
root /home/deploy/awesome-game/awesome_game/static/images;
}
location /socket.io {
include proxy_params;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:5000/socket.io;
}
}
# Redirect request without WWW or HTTPS
server {
listen 80;
server_name awesome-game.me;
location /.well-known/ {
root /var/www/html/;
}
location / {
return 301 https://www.$host$request_uri;
}
}
server {
listen 80;
server_name www.awesome-game.me;
location /.well-known/ {
root /var/www/html/;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name awesome-game.me;
ssl_certificate /etc/letsencrypt/live/www.awesome-game.me/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.awesome-game.me/privkey.pem;
return 301 https://www.$host$request_uri;
}