-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.conf
37 lines (31 loc) · 1.25 KB
/
default.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
server {
listen 8080;
server_name localhost;
port_in_redirect off;
root /usr/share/nginx/html;
index index.html index.html;
error_page 404 /custom_404.html;
error_page 500 /custom_500.html;
gzip on;
gzip_min_length 1000;
gzip_types text/plain application/xml application/javascript application/json text/css font/woff2;
set $cors_enabled @@CORS_ENABLED;
if ($cors_enabled) {
set $cors_origin $http_origin;
set $cors_cred true;
set $cors_header $http_access_control_request_headers;
set $cors_method $http_access_control_request_method;
}
add_header Access-Control-Allow-Origin $cors_origin;
add_header Access-Control-Allow-Credentials $cors_cred;
add_header Access-Control-Allow-Headers $cors_header;
add_header Access-Control-Allow-Methods $cors_method;
# Disable cache by default
add_header X-Content-Type-Options "nosniff";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header Cache-Control "private, no-cache, no-store, must-revalidate";
add_header Expires "Sat, 01 Jan 2000 00:00:00 GMT";
add_header Pragma no-cache;
include "/etc/nginx/conf.d/locations/*.conf";
}