From 595cba3ab314b66e9eee89d9afddf355f4057b3c Mon Sep 17 00:00:00 2001 From: Jeremy Walker Date: Wed, 8 Jan 2025 23:19:13 +0000 Subject: [PATCH] Remove duplicate block --- docker/nginx.conf | 47 +++++------------------------------------------ 1 file changed, 5 insertions(+), 42 deletions(-) diff --git a/docker/nginx.conf b/docker/nginx.conf index d3cc9b5dcd..b989fbe2d1 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -65,42 +65,16 @@ http { access_log off; } } - + server { - listen 80; server_name bootcamp.exercism.org; location / { - # Reject requests with unsupported HTTP method - if ($request_method !~ ^(GET|POST|HEAD|OPTIONS|PUT|DELETE|PATCH)$) { - return 405; - } - - # Rewrite to go to bootcamp path - rewrite /bootcamp/(.*) /bootcamp/$1 break; - rewrite /(.*) /bootcamp/$1 break; + # Rewrite rule to remove the /bootcamp prefix if it exists + rewrite ^/bootcamp(/.*)?$ $1 break; - # Only requests matching the whitelist expectations will - # get sent to the application server - proxy_pass http://127.0.0.1:3000; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-Proto https; - proxy_cache_bypass $http_upgrade; - } - - location /favicon.ico { - return 404; - log_not_found off; - access_log off; - } - - location /apple-touch-icon { - return 404; - log_not_found off; - access_log off; + # Redirect to the desired URL with the remaining path + return 301 https://exercism.org/bootcamp$request_uri; } } @@ -146,15 +120,4 @@ http { server_name www.exercism.org .exercism.io .exercism.net .exercism.com .exercism.lol; return 301 https://exercism.org$request_uri; } - server { - server_name bootcamp.exercism.org; - - location / { - # Rewrite rule to remove the /bootcamp prefix if it exists - rewrite ^/bootcamp(/.*)?$ $1 break; - - # Redirect to the desired URL with the remaining path - return 301 https://exercism.org/bootcamp$request_uri; - } - } }