-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.conf
66 lines (52 loc) · 1.47 KB
/
server.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
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream websocket {
server couloirs:4000;
}
server {
listen 80;
server_name api.sundaypeak.com;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www/html;
}
location / {
rewrite ^ https://$host$request_uri? permanent;
}
}
server {
client_max_body_size 15M;
listen 443 ssl http2;
server_name api.sundaypeak.com;
ssl_certificate /etc/letsencrypt/live/api.sundaypeak.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.sundaypeak.com/privkey.pem;
ssl_protocols TLSv1.3;
location /ws {
try_files $uri @couloirs;
}
location / {
try_files $uri @rivers;
}
location @couloirs {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location @rivers {
proxy_pass http://rivers:5000;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
}
root /var/www/html;
index index.html;
}
}
events { }