-
Notifications
You must be signed in to change notification settings - Fork 2
/
nginx.conf
54 lines (45 loc) · 2.03 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
upstream camus_upstream {
ip_hash; # websocket connections need a constant server
server localhost:5000;
}
server {
server_name ${domain};
listen 80;
location / {
# Redirect to use HTTPS
return 301 https://$host$request_uri;
}
}
server {
server_name ${domain};
listen 443 ssl;
# Let's Encrypt certificate and key
ssl_certificate /etc/ssl/certs/camus.pem;
ssl_certificate_key /etc/ssl/private/camus-key.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_prefer_server_ciphers on;
#ssl_dhparam /etc/nginx/dhparams.pem;
root /var/www/chat;
index index.html;
location / {
proxy_pass http://camus_upstream;
proxy_http_version 1.1;
}
# Serve static files directly with nginx
#location /static {
# alias /var/www/camus/static/;
# add_header Cache-Control "no-cache";
#}
location ~ ^/chat/(?<room_id>.+)/ws {
# These settings are needed for websockets
proxy_pass http://camus_upstream/chat/$room_id/ws;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 300;
proxy_send_timeout 300;
}
}