-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Real time html behind reverse proxy returns HTTP status 400 #2270
Comments
Hi @elya5 Humm... It is not so simple like as you think... Try to search, at internet, about Caddy server with WebSocket. I hope that helped you. |
Is there any option for more detailed log about? I already tried |
What's the output from your browser's console? Also, did you look at that guide I posted before? did it help? |
Yes, I looked at the guide and the configuration but still couldn't figure it out. I start goaccess with the following config: The browser is sending the following request:
And receives the following response:
If I stop goaccess and run netcat on the same port, I receive the following request:
|
@elya5 not sure if this is helpful or relevant anymore, but I'm using caddy with reverse proxy and websocket works goaccess config
caddy config
Try removing wss:// part from --ws-url option. Another problem I see in your config is that goaccess is expecting to serve websocket on example.domain as specified by your --ws-url but you're reverse proxying on localhost. Try adding --addr=localhost |
@demifiend9 Thanks a lot for sharing that. @elya5 did that help? |
Thanks @demifiend9 for the info. I probably missed the connection upgrade, however even with the changes it still does not work. Here is the caddy config part:
The goaccess call: The browser shows the following request:
and the following response:
It seems that maybe Caddy is directly responding to request without forwarding it to goaccess. |
Hi @elya5 Maybe your I think you must declare humm... Another point is if you use port 443 then need use |
@elya5 You don't need to use /ws path for hosting the webscoket as caddy will match the websocket headers to correctly reverse proxy it. remove /ws from both configs Try this.
If it still doesn't work then it's probably a problem with /service path of your proxy server above caddy. Reverse proxies are known to not play well with paths, thats why it's preferred to use a different subdomain to reverse proxy to, instead of url path like /service. You can test if it indeed is a problem with /service url by trying to caddy reverse proxy into any other application (for example qbittorrent webui) and see if they work. You can also try to remove /service url completely from your proxy and host goacces directly under / just to test if the websocket works. Another way to do this is using uri strip_prefix. |
I have issues setting up the real time view behind a reverse proxy. There are many other issues here about the same topic but I still couldn't figure it out.
Setup: I have a server with Caddy as a reverse proxy and I would like to set up goaccess for it. This server sits behind another server with reverse proxy handling SSL etc. which is available to the public. The outer server forwards the request and rewrites the path (in case that's relevant).
So a user visits https://example.domain/service/goaccess.html and my server only sees http://hostname/goaccess.html.
Now I tried to run goaccess the following way:
with the caddy directive
When I open the site in the browser, I can see the not-updated statistics and the site correctly tries to connect to
wss://example.domain/service/ws
, however HTTP status code 400 is returned. Running another service (likepython -m http.server 7890
), I can see that the request arrives. Apparently goaccess refuses to answer it. Does anyone know what's the issue here?The text was updated successfully, but these errors were encountered: