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

https website forcibly redirects to http #7

Open
srnthsrdhrn opened this issue Aug 14, 2021 · 9 comments
Open

https website forcibly redirects to http #7

srnthsrdhrn opened this issue Aug 14, 2021 · 9 comments
Assignees

Comments

@srnthsrdhrn
Copy link

I am using snitchdns deployed over docker. The DNS as such works fine. The difficulty is in accessing the ui.

Only the https server is working. http just returns not found response.

Morevoer whenever I submit a form in the ui, it redirects to the http site and goes to 404 not found.

I have to manually change the url each time from http to https.

If this bug is fixed, the system is really easy to setup and use.

@sadreck
Copy link
Contributor

sadreck commented Aug 14, 2021

Thanks for reporting this.

I'm not able to reproduce this using a standard setup in my VM - in the past however, this issue was caused by running SnitchDNS using SSH tunnels (which was fixed).

Could you please describe your setup, and could you confirm you're using the latest and greatest Dockerfile?

@srnthsrdhrn
Copy link
Author

I have deployed it in a vm directly. I am accessing the DNS through openvpn. Is that causing the issue?

I am using the latest docker file. I just set it up like 5 days back. Cloned the repo and ran the instructions according to the readme. Built the dockerfile and ran it.

@sadreck
Copy link
Contributor

sadreck commented Aug 18, 2021

Thanks for the update - I'll have a look and try to reproduce the issue locally.

@sadreck sadreck self-assigned this Sep 14, 2021
@sadreck
Copy link
Contributor

sadreck commented Oct 30, 2021

Hi @srnthsrdhrn - are you still having this issue?

@jnehlmeier
Copy link

@sadreck The issues still exists. Just cloned the repo and did the build/run command and the UI runs on HTTPS port but constantly redirects to HTTP (http://localhost/install for example upon first request after start).

@sadreck
Copy link
Contributor

sadreck commented Mar 4, 2022

@jnehlmeier could you describe your setup please? Things like:

  • Which OS are you using?
  • Where are you installing it? Cloud, local/lan VM?
  • How are you connecting to it? Is there a VPN in place? Are you using SSH tunnels?
  • Are you behind any sort of load balancer that rewrites origin IPs?
  • Are you running the Docker image or are you manually installing it?
  • Anything else that you think might help me reproduce this?

@jnehlmeier
Copy link

Really nothing special.

I use docker on macOS 10.15.7 and simply did your short tutorial without modifying any dockerfile build arg.

Then I executed docker run -p 80:80 -p 443:443 -p 5311:2024/udp --name snitch snitchdns and opened http://localhost which shows me the default apache index html page. Then I opened https://localhost which redirected to http://localhost/install so I had to change it back to https://localhost/install in order to see the UI. Then in your ADMIN UI after saving anything it usually redirects to HTTP instead fo HTTPS. Switching menu items works though (except opening the system settings at the top right).

@jnehlmeier
Copy link

jnehlmeier commented Mar 5, 2022

Ok I have to correct me. I already had something running on port 80 and 443 and thus used different ports. And that seems to be the issue.

  1. Add 127.0.0.1 www.snitch.docker to /etc/hosts
  2. Execute docker run -p 8800:80 -p 4430:443 -p 5300:2024/udp --name snitch snitchdns
  3. Open http://www.snitch.docker:8800
  4. You will be redirected to https://www.snitch.docker:8800 which obviously fails to load
  5. Change URL to https://www.snitch.docker:4430
  6. You will be redirected to http://www.snitch.docker:4430/install/ and you see the message that a HTTP request has been done to a HTTPS port. So for some reason a HTTPS to HTTP redirect has been done here. This kind of redirect now always happens when saving settings as already mentioned above.
  7. Change URL back to https:// to see the install page

If I run the app with published port 80 and 443 everything works as expected.

@sadreck
Copy link
Contributor

sadreck commented Mar 9, 2022

Thanks for the detailed steps! I'll have a look when I get some downtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants