2021-07-07 19:47:44 +00:00
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
server_name localhost;
|
|
|
|
|
|
|
|
#access_log /var/log/nginx/host.access.log main;
|
|
|
|
|
2021-07-14 21:17:38 +00:00
|
|
|
location /static {
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
expires max;
|
|
|
|
}
|
|
|
|
|
2021-07-09 00:00:15 +00:00
|
|
|
location /signatures {
|
2021-07-07 19:47:44 +00:00
|
|
|
root /usr/share/nginx/html;
|
2021-07-09 17:41:48 +00:00
|
|
|
expires 30d;
|
2021-07-09 00:00:15 +00:00
|
|
|
|
|
|
|
# Base on: https://michielkalkman.com/snippets/nginx-cors-open-configuration/
|
|
|
|
if ($request_method = 'OPTIONS') {
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
2021-09-24 04:07:24 +00:00
|
|
|
#
|
|
|
|
# Om nom nom cookies
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
|
|
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
|
|
|
|
|
|
|
|
#
|
|
|
|
# Custom headers and headers various browsers *should* be OK with but aren't
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
|
|
|
|
|
|
#
|
|
|
|
# Tell client that this pre-flight info is valid for 20 days
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Max-Age' 1728000;
|
|
|
|
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
|
|
|
add_header 'Content-Length' 0;
|
|
|
|
return 204;
|
|
|
|
}
|
|
|
|
if ($request_method = 'GET') {
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
|
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
|
|
|
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
|
|
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
location /with_parameter_names {
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
expires 30d;
|
|
|
|
|
|
|
|
# Base on: https://michielkalkman.com/snippets/nginx-cors-open-configuration/
|
|
|
|
if ($request_method = 'OPTIONS') {
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
2021-07-09 00:00:15 +00:00
|
|
|
#
|
|
|
|
# Om nom nom cookies
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
|
|
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
|
2021-07-07 19:47:44 +00:00
|
|
|
|
2021-07-09 00:00:15 +00:00
|
|
|
#
|
|
|
|
# Custom headers and headers various browsers *should* be OK with but aren't
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
|
|
|
|
|
|
#
|
|
|
|
# Tell client that this pre-flight info is valid for 20 days
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Max-Age' 1728000;
|
|
|
|
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
|
|
|
add_header 'Content-Length' 0;
|
|
|
|
return 204;
|
|
|
|
}
|
|
|
|
if ($request_method = 'GET') {
|
2021-07-09 17:41:48 +00:00
|
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
|
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
|
|
|
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
|
|
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
|
2021-07-09 00:00:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
location /assets {
|
|
|
|
root /usr/share/nginx/html;
|
2021-07-09 17:41:48 +00:00
|
|
|
expires 30d;
|
2021-07-09 00:00:15 +00:00
|
|
|
|
2021-07-07 19:47:44 +00:00
|
|
|
# Base on: https://michielkalkman.com/snippets/nginx-cors-open-configuration/
|
|
|
|
if ($request_method = 'OPTIONS') {
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
|
|
#
|
|
|
|
# Om nom nom cookies
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
|
|
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS';
|
|
|
|
|
|
|
|
#
|
|
|
|
# Custom headers and headers various browsers *should* be OK with but aren't
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
|
|
|
|
|
|
#
|
|
|
|
# Tell client that this pre-flight info is valid for 20 days
|
|
|
|
#
|
|
|
|
add_header 'Access-Control-Max-Age' 1728000;
|
|
|
|
add_header 'Content-Type' 'text/plain charset=UTF-8';
|
|
|
|
add_header 'Content-Length' 0;
|
|
|
|
return 204;
|
|
|
|
}
|
|
|
|
if ($request_method = 'GET') {
|
2021-07-09 17:41:48 +00:00
|
|
|
add_header 'Access-Control-Allow-Origin' '*' always;
|
|
|
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
|
|
|
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
|
|
|
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
|
2021-07-07 19:47:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-09 00:00:15 +00:00
|
|
|
location / {
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
index index.html;
|
|
|
|
try_files $uri /index.html;
|
|
|
|
}
|
|
|
|
|
2021-07-07 19:47:44 +00:00
|
|
|
#error_page 404 /404.html;
|
|
|
|
|
|
|
|
# redirect server error pages to the static page /50x.html
|
|
|
|
#
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location = /50x.html {
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|