fix nginx marketing page issue for on-prem isntall.

This commit is contained in:
Simon Larsen 2023-08-09 13:25:34 +01:00
parent a474af6c0f
commit 97fad39d27
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -167,7 +167,10 @@ server {
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
set $billing_enabled ${BILLING_ENABLED};
location / {
proxy_set_header Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -177,8 +180,17 @@ server {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://home;
# If billing_enabled is true then proxy to home otherwise to dashboard because we dont need marketing paages for on-prem install.
if ($billing_enabled = true) {
proxy_pass http://home;
}
if ($billing_enabled != true) {
proxy_pass http://dashboard;
}
}
location /accounts {
proxy_set_header Host $host;