-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
63 lines (48 loc) · 1.37 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
upstream api {
server api:4000;
}
# Cache control for css, js, fonts and images
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css 1d;
application/javascript 1d;
application/woff2 1d;
~image/ 1d;
}
# server {
# listen 80;
# return 301 https://$host$request_uri;
# }
server {
# listen 443 ssl;
listen 4200;
server_name localhost;
# ssl_certificate /etc/nginx/ssl/mean.crt;
# ssl_certificate_key /etc/nginx/ssl/mean.key;
expires $expires;
sendfile on;
default_type application/octet-stream;
gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 1000;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html =404;
}
location /api {
proxy_pass http://api;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_http_version 1.1;
}
}