Hello,
We want to forward status.domain.tld (a cPanel account with that domain name is created) to domaintld.freshstatus.io in order to serve a status page from Freshstatus using a domain name with SSL. In their instructions at How can I host my Freshstatus status page on a custom domain? they have an NGINX directive.
The code we added is the following:
When the code is added on /etc/nginx/conf.d/users/USERNAME.conf replacing the current code for "location /" everything works like a charm, however that file gets ovewritten from cPanel periodically. At NGINX with Reverse Proxy | cPanel & WHM Documentation we see that we can use includes (in the main config file the line "include conf.d/users/USER/status.domain.tld/*.conf;" is already there), so we created /etc/nginx/conf.d/users/USERNAME/status.domain.tld/fresh.conf with the above contents.
-When we comment out the "location /" lines fron /etc/nginx/conf.d/users/USERNAME.conf and restart NGINX, the include file works, however when we do not comment them out, we get the following error while trying to start NGINX:
nginx: [emerg] duplicate location "/" in /etc/nginx/conf.d/users/USERNAME/status.domain.tld/fresh.conf:1
How can I add custom directive for / without editing the main file (to remove the existing entries) since it gets ovewritten by cPanel?
We want to forward status.domain.tld (a cPanel account with that domain name is created) to domaintld.freshstatus.io in order to serve a status page from Freshstatus using a domain name with SSL. In their instructions at How can I host my Freshstatus status page on a custom domain? they have an NGINX directive.
The code we added is the following:
Code:
location / {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://domaintld.freshstatus.io;
}
-When we comment out the "location /" lines fron /etc/nginx/conf.d/users/USERNAME.conf and restart NGINX, the include file works, however when we do not comment them out, we get the following error while trying to start NGINX:
nginx: [emerg] duplicate location "/" in /etc/nginx/conf.d/users/USERNAME/status.domain.tld/fresh.conf:1
How can I add custom directive for / without editing the main file (to remove the existing entries) since it gets ovewritten by cPanel?