Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 Bad Gateway #108

Open
Sietsevdm opened this issue Dec 27, 2024 · 14 comments
Open

502 Bad Gateway #108

Sietsevdm opened this issue Dec 27, 2024 · 14 comments
Labels
help wanted Extra attention is needed

Comments

@Sietsevdm
Copy link

So i've setup portainer on a VPS and got wrapperr up and running but i want to set it up with a custom domain which i own.
I have nginx proxy manager running and created a proxy host with an SSL certificate but i keep getting a 502 bad gateway.

chrome_X0c5TWQrpZ
chrome_hrUR6epEyz

I also have A records in the DNS records
chrome_GzCx0ylu86

For portainer i did the same as i stated above and that is working like a dream.
I also added the same custom domain in the Wrapperr settings

What am i doing wrong?

@wbshaw
Copy link

wbshaw commented Dec 27, 2024

In the wrapper URL field, what do you have set? For mine I use "https://[mydomain.host.net]:33505/", with port forwarding from 33505 (external) to 8282 (internal) on the fw. Works fine. The wrapper console or log should also indicate if something is connecting, even if there's an issue...
I set the SSL certificate in Wrapperr itself though, rather than through a proxy.

@wbshaw
Copy link

wbshaw commented Dec 27, 2024

Ideally you want to see what the nginx error log says as that will point you in the right direction.

@wbshaw
Copy link

wbshaw commented Dec 27, 2024

My guess would be that you're trying to pass SSL to Wrapperr, you should change the nginx config to proxy pass to http... Lots of guides on nginx Https to http proxy out there.
You could try using the same SSL certs on both the proxy and in Wrapperr (see the wiki on enabling SSl in Wrappert) but not 100% sure that would work.

Or you could just use the SSL capability in Wrapperr and just have nginx as a straight pass-through.

@Sietsevdm
Copy link
Author

@wbshaw its set like this
chrome_YfO754XLT9

i am pretty new to all this docker/portainer stuff.
When i go to "mydomain.xyz:32768" it works but i want it to work with a subdomain just like portainer is doing

@wbshaw
Copy link

wbshaw commented Dec 27, 2024

Try adding the port to the wrapper URL field
E.g.
Screenshot_20241227-185959

@Sietsevdm
Copy link
Author

@wbshaw i just tried that but did not fix the issue.

@wbshaw
Copy link

wbshaw commented Dec 27, 2024

Would need to see what's in the error logs to understand where the issue is, otherwise just taking wild guesses now.
Are you able to share a redacted version of the error from nginx logs?

@wbshaw
Copy link

wbshaw commented Dec 27, 2024

Can you see anything in the wrapperr logs as well? If I try to connect over http for example I get this in Wrapperr:
Screenshot_20241227-191636~2

@Sietsevdm
Copy link
Author

@wbshaw I've pulled these and replaced the domain name to mydomain, the email adress is replaced with myemail
Not sure if you need these or other ones

_nginx-proxy-manager-app_logs (2).txt

@wbshaw
Copy link

wbshaw commented Dec 27, 2024

The only 502 error I see in there is for uptime.mydomain.xyz, not for wrapped.mydomain.xyz, although I can see the certificate request for wrapped in the logs, just before the request for uptime. Is there a conflicting config with uptime maybe?

@Sietsevdm
Copy link
Author

@wbshaw i deleted all records for uptime so there shouldn't be.
Would you perhaps be open to take a look via teamviewer?

@aunefyren
Copy link
Owner

The Wrapperr URL setting is mostly used for linking toward the external URL of the website. Like when generating a URL for links. Changing it will not alter the hosting of the server itself.

The server is always running on HTTP, unless it is provided with certificates. Using a reverse proxy is not doing that, as that is invisible to the Wrapperr server. You must reverse proxy within Nginx toward Wrapperr using HTTP, with an IP and port that can reach it.

I am not sure of your network setup, but I think your domain shoud redirect to [REACHABLE WRAPPERR IP], toward port 32678 (is this the port Wrapperr is running on?), using HTTP. We can validate this if you have a valid connection in your browser using a local IP. Feel free to also share Docker commands/compose, Nginx setup and so on.

@aunefyren aunefyren added the help wanted Extra attention is needed label Dec 29, 2024
@Sietsevdm
Copy link
Author

@aunefyren changing to http in the proxy manager fixed the issue but when i open the URL on mobile it automatically goes to https for some reason.

Desktop is working fine now

@aunefyren
Copy link
Owner

That could be browser caching, could you try incognito mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants