Skip to content

Commit

Permalink
Remove duplicate block
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD committed Jan 8, 2025
1 parent 7b1e733 commit 595cba3
Showing 1 changed file with 5 additions and 42 deletions.
47 changes: 5 additions & 42 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}
}

0 comments on commit 595cba3

Please sign in to comment.