cloudpanel-io/cloudpanel-ce

Error creating/updating vhost file when updating reverse proxy url

Closed this issue · 2 comments

e77 commented

CloudPanel version(s) affected

2.4.2

Description

when trying to update the reverse proxy url via the UI the following error is displayed:

An error has occurred, error message: nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in /etc/nginx/sites-enabled/stock.echo77.com.conf:19 nginx: configuration file /etc/nginx/nginx.conf test failed

Removing lies 14 and 15

if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;

results in the following error

Vhost is not valid, error message: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/sites-enabled/stock.echo77.com.conf:15 nginx: configuration file /etc/nginx/nginx.conf test failed

incidentally the reverse proxy didn't work anyway - presumably because the url isn't in the vhost file as expected, and it can't be done with regex, so nginx doesn't know where to pass the traffic to.

Eitherway, the vhost file doesn't appear to be created correctly when setting up a reverse proxy.

How to reproduce

Update an existing reverse proxy url (which doesnt work anyway....) via the UI or by tring to edit row 19 of the vhost file via the UI.

Possible Solution

No response

Additional Context

No response

It's very hard for me to reproduce it.

If you can reproduce it, please join our discord server https://discord.cloudpanel.io and contact stefan.wieczorek there.

I am happy to help you.

e77 commented

I'll confess, I raised the bug report, because I don't understand how discord works :)