summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-05-21 21:11:19 -0400
committerFreya Murphy <freya@freyacat.org>2024-05-21 21:11:19 -0400
commit8d544d58af232e82c740cfcb271d20965020c133 (patch)
treeb258dacda826fe8ca7d9c703588262a153b9f6d5 /conf
parentfix modals (diff)
downloadxssbook2-8d544d58af232e82c740cfcb271d20965020c133.tar.gz
xssbook2-8d544d58af232e82c740cfcb271d20965020c133.tar.bz2
xssbook2-8d544d58af232e82c740cfcb271d20965020c133.zip
things
Diffstat (limited to 'conf')
-rw-r--r--conf/nginx/site.conf34
1 files changed, 5 insertions, 29 deletions
diff --git a/conf/nginx/site.conf b/conf/nginx/site.conf
index ed9bff0..04c75ca 100644
--- a/conf/nginx/site.conf
+++ b/conf/nginx/site.conf
@@ -30,41 +30,13 @@ server {
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon;
location /api/ {
-
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin $http_origin' always;
- # Om nom nom cookies
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- # Custom headers and headers various browsers *should* be OK with but aren't
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,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 = 'POST') {
- add_header 'Access-Control-Allow-Origin $http_origin' always;
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- }
-
- if ($request_method = 'GET') {
- add_header 'Access-Control-Allow-Origin $http_origin' always;
- add_header 'Access-Control-Allow-Credentials' 'true';
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
- }
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Accept-Encoding "";
proxy_redirect off;
default_type application/json;
+ add_header 'Access-Control-Allow-Origin' '*';
add_header Content-Location /api/$upstream_http_content_location;
proxy_set_header Connection "";
proxy_http_version 1.1;
@@ -72,21 +44,25 @@ server {
}
location /apidocs {
+ add_header 'Access-Control-Allow-Origin' '*';
proxy_http_version 1.1;
proxy_pass http://swagger;
}
location /favicon.ico {
+ add_header 'Access-Control-Allow-Origin' '*';
root /opt/xssbook/public;
add_header Cache-Control "public, max-age=108000";
}
location /public {
+ add_header 'Access-Control-Allow-Origin' '*';
try_files $uri =404;
add_header Cache-Control "public, max-age=108000";
}
location / {
+ add_header 'Access-Control-Allow-Origin' '*';
root /opt/xssbook/web;
include fastcgi_params;
fastcgi_pass php:9000;