-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnginx.conf
More file actions
35 lines (29 loc) · 1.15 KB
/
nginx.conf
File metadata and controls
35 lines (29 loc) · 1.15 KB
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
server {
listen 8080 default_server;
charset utf-8;
gzip on;
gzip_types text/plain text/xml application/xml text/css application/javascript;
root /usr/share/nginx/html;
error_page 404 /404.html;
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin $http_origin always;
add_header Access-Control-Allow-Methods 'GET,OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header Access-Control-Expose-Headers 'Content-Length,Content-Range';
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
location ~ (^/img/)|(\.(css|js)$) {
expires max;
etag off;
add_header Cache-Control public;
add_header Cache-Control immutable;
add_header Access-Control-Allow-Origin *;
}
}
}