sameerdhoot / wolweb

Web interface for sending Wake-on-lan (magic packet). An HTTP server built using GoLang and uses Bootstrap for UI.
GNU General Public License v3.0
297 stars 76 forks source link

Empty vdir not working with reverse proxy #10

Closed Czechball closed 1 year ago

Czechball commented 2 years ago

Hello. I'm trying to use wolweb with a reverse proxy (Caddy). When I leave the default "/wolweb" vdir and create this Caddy directive:

127.0.0.1:80 {
    reverse_proxy 127.0.0.1:8088
}

I can access wolweb at localhost:80/wolweb, as intended. But I'd like to ommit the /wolweb part, so I changed "vdir" in wolweb's config to just "/", and now when I try to visit localhost:80, I get too many redirects.

rdgerken commented 1 year ago

Can anyone confirm this merge fixes this problem? I'm trying this behind Traefik 2, using "/" for the vdir environment variable - and I can't get it to work through the proxy using a subdomain with no path (502 error). Hitting it locally with http://:8089 with no path works fine.

abelgomez commented 1 year ago

I tried the latest code at https://github.com/sameerdhoot/wolweb/commit/92bd05d0541b308b0d06c64d808c5826d938e75f, and the "/" vdir does not work for me (I still enter in a loop of 302 redirects) when getting http://mysite:8089 (for obvious reasons, I didn't even try my reverse proxy serving on https).

abelgomez commented 1 year ago

Ooops, my mistake, I didn't properly refresh my environment.

I confirm that the latest code in https://github.com/sameerdhoot/wolweb/commit/92bd05d0541b308b0d06c64d808c5826d938e75f indeed does work, both directly from the wolweb serving on 8089, and through an nginx proxy listening on 443.

I had to thoroughly clean cached stuff in my web browser.

rdgerken commented 1 year ago

Thank you for confirming. I'll keep trying with Traefik.

sameerdhoot commented 1 year ago

@rdgerken I hope you are able to find a working solution. I am closing this issue since it is user environment/config issue.