Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

HTTP requests using local network address for host redirect to external host IP #428

Open
jbrzusto opened this issue Dec 18, 2018 · 4 comments

Comments

@jbrzusto
Copy link
Owner

courtesy of @denislepage:

The web server requires an https connection, so going to the local IP
forwards me to the external domain.

I.E., http://10.100.100.12/ sends me to https://sgdata.motus.org/

Fix

  • fix redirect rule to reflect incoming HOST component
@denislepage
Copy link
Collaborator

Thanks,

however, when trying to access the local IP, I am still being redirected to the external domain name. What condition should prevent it from redirecting?

@jbrzusto
Copy link
Owner Author

Sorry, my rebuild of the package after making this change had failed in a strange way that I didn't notice,
which restored the apache config files to what they had been before the change. It is working now:

curl http://10.100.100.12
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://10.100.100.12">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at 10.100.100.12 Port 80</address>
</body></html>

@denislepage
Copy link
Collaborator

closer, but it still tries to convert the http to an https, which doesn't work with IP addresses.

@denislepage denislepage reopened this Dec 20, 2018
@jbrzusto
Copy link
Owner Author

Right.
Can you add the line

10.100.100.12 sgdata.motus.org

to your server's hosts file?
Then you can still use https://sgdata.motus.org but the request will route via the local network.

Or are you hoping to avoid using https altogether? If so, how secure is the local network?
Are other machines hosted by kwic on the same subnet, or is 10.100.100.x only for motus?

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

No branches or pull requests

2 participants