Skip to content

Commit

Permalink
tested different CORS configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jan 14, 2024
1 parent 1fd1df7 commit b4cd41a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 4 additions & 6 deletions data/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ http {
# Do not show the version of nginx running on the server
server_tokens off;

# we allow other sites to fetch from us as we don't have any login/.. functionality => no cookies
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;

server {
# default_server makes nginx not care about HOST, we hande this upstream by Traefik
listen 3002 default_server;
Expand All @@ -29,12 +33,6 @@ http {
gzip_static on;
gzip_vary on;

# we allow other sites to fetch from us as we don't have any login/.. functionality => no cookies
location / {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
}

location = /cdn/health {
access_log off;
add_header Content-Type text/plain;
Expand Down
10 changes: 4 additions & 6 deletions webclient/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ http {
"light" "light";
}

# we allow other sites to fetch from us as we don't have any login/.. functionality => no cookies
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;

server {
# default_server makes nginx not care about HOST, we hande this upstream by Traefik
listen 3000 default_server;
Expand All @@ -38,12 +42,6 @@ http {

root /app;

# we allow other sites to fetch from us as we don't have any login/.. functionality => no cookies
location / {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
}

# metadata
location = /robots.txt { access_log off; }
location = /googlebef9161f1176c5e0.html { access_log off; return 200 'google-site-verification: googlebef9161f1176c5e0.html'; } # google search console
Expand Down

0 comments on commit b4cd41a

Please sign in to comment.