-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
45 lines (39 loc) · 1.51 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
events {
worker_connections 1024;
}
http {
include ./mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
large_client_header_buffers 4 16k;
gzip on;
gzip_vary on;
gzip_min_length 256;
gzip_proxied expired no-cache no-store private auth;
gzip_types application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component;
resolver 127.0.0.11 ipv6=off; # internal Docker DNS resolver
server {
gzip_static always;
gzip_proxied expired no-cache no-store private auth;
location /api/ws {
proxy_pass http://api:8080/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
rewrite /api(.*) $1 break;
}
location /api/ {
proxy_pass http://api:8080/;
rewrite /api(.*) $1 break;
}
location ^~ / {
alias /usr/share/nginx/html/;
if (!-e $request_filename) { rewrite ^ /index.html last; }
if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
expires 1M;
add_header Cache-Control "public, no-transform";
}
}
}
}