Skip to content

Commit

Permalink
feat: in the arena... trying stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfromyeg committed Jan 7, 2024
1 parent f7f0447 commit a726a09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
16 changes: 1 addition & 15 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,8 @@ server {
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
add_header 'Access-Control-Allow-Origin' 'https://bereal.michaeldemar.co' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization' always;

location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'https://bereal.michaeldemar.co';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Content-Type, Authorization';
add_header 'Content-Length' 0;
add_header 'Content-Type' 'text/plain; charset=utf-8';
return 204;
}

if ($request_method !~ ^(GET|POST)$) {
if ($request_method !~ ^(GET|POST|OPTIONS)$) {
return 403;
}

Expand Down
3 changes: 3 additions & 0 deletions scripts/test-nginx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

docker run --rm -v ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro nginx nginx -t

0 comments on commit a726a09

Please sign in to comment.