generated from Borodutch/frontend-starter-vue
-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
nginx.conf
56 lines (47 loc) · 1.42 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
#
# Nginx config for DockerImage
#
server {
server_name localhost;
listen 80;
# basic security
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
add_header Referrer-Policy "no-referrer-when-downgrade";
# compress
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types image/* text/plain text/css text/javascript text/xml application/json application/javascript application/x-javascript application/xml application/xml+rss;
root /var/www;
index index.html index.htm;
access_log off;
# all to index.html
location / {
root /var/www;
try_files $uri $uri/ index.html;
add_header Cache-Control "no-store, no-cache, must-revalidate";
# expires 1h;
access_log off;
}
# cache static
location ~* \.(?:ico|css|js|json|xml|gif|jpe?g|png|svg|woff|eot|ttf|ogg)$ {
expires 1d;
add_header Pragma public;
add_header Cache-Control 'public';
access_log off;
# try_files $uri @rewrite;
}
# Error pages
error_page 404 /index.html; # SPA =)
#error_page 403 500 502 503 504 /error.html;
# Forward API requests to backend
location ^~ /api/ {
proxy_pass http://backend:1337/;
}
}