Refactor Nginx configuration to handle billing redirection***

This commit is contained in:
Simon Larsen 2024-03-31 13:55:50 +01:00
parent 1ac7c646d5
commit 1b61d7a641
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -127,21 +127,34 @@ server {
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
if ($billing_enabled = true) {
return 301 https://$host$request_uri;
}
proxy_pass http://status-page;
if ($billing_enabled != true) {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://status-page;
}
}
location /status-page {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
if ($billing_enabled = true) {
return 301 https://$host$request_uri;
}
proxy_pass http://status-page;
if ($billing_enabled != true) {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://status-page;
}
}
location /status-page-api/ {