-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathnginx.conf
50 lines (38 loc) · 1.31 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
server {
listen 80;
server_name localhost;
root /srv/ce;
location / {
# Enable gzip compression only for static files.
gzip_static on;
# Enables response header of "Vary: Accept-Encoding".
# It allows to serve both versions: compressed and not.
gzip_vary on;
# No-cache doesn’t mean “don’t cache”, it means it must revalidate with the server before using the cached resource.
add_header Cache-Control 'no-cache';
# Enable entity tag to revalidate cache.
etag on;
# Serve files.
try_files $uri $uri/ /index.html;
}
location /api/ {
# Docker resolver.
resolver 127.0.0.11;
# TODO: finalize "proxy_http_version" and "proxy_pass".
proxy_http_version 1.1;
# Don't remove trailing slash, it cuts "/api" prefix.
proxy_pass http://${DLE_HOST}:${DLE_PORT}/;
}
location /ws/ {
# Docker resolver.
resolver 127.0.0.11;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# Increase timeout to keep connection.
proxy_read_timeout 7d;
proxy_send_timeout 7d;
rewrite ^/ws(/.*) $1 break;
proxy_pass http://${DLE_HOST}:${DLE_PORT}/;
}
}