cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

Localhost not connecting to server

I opted to have GoDaddy install my SSL Certificate for my domain and now my server will not connect to localhost.  I have a node js app running which sends out an email when my website needs.  Before i could connect to localhost at any time and test but now i get a http 404 error.  Has anyone else run into anything like this?

1 ACCEPTED SOLUTION

The localhost reverse proxy should still work. Response from a subdomain ... so long as it's fully behind the reverse proxy ... should be ok as well. 

 

It's fairly common to have https on the perimeter (which would be your main https domain), terminated on the web server, with everything inside the perimeter, e.g., reverse proxies, using plain http. 

 

... but everything can get easily complicated 🙂

 

 

View solution in original post

5 REPLIES 5
Resolver III

This may not be a definite answer but it's possible that the SSL "upgrade" has either disabled port 80/http or your application rejects https with your new certificate (it would check the certificate against the name you use and "localhost" would not be found in your certificate).

 

You have to start using your proper domain name instead of localhost. If you still want to connect to "localhost" / IP address 127.0.0.1, you can add this to your test/development machine.

 

If it's Linux or Mac, open "/etc/hosts"  and add there a line:

127.0.0.1   mydomain.com

 

on Windows, the file to edit is "c:\Windows\System32\Drivers\etc\hosts"

 

... this way you can use "https://mydomain.com" ... and it will connect to the IP address 127.0.0.1

 

a longer blog post is for example here - https://support.rackspace.com/how-to/modify-your-hosts-file/

 

Dan

 

———

I've worked with SSL security for over 20 years in enterprises and startups. 

I am now running an HTTPS expiry management service KeyChest.net

Well my application isn’t rejecting it because I am getting directly onto the server and trying to reach that end point and fix that before the application ever has a chance to try. It was working perfectly fine before the upgrade and I added test end points for situations like this just to be able to test the connection. So is it possible that http has been blocked and https won’t recognize localhost because it hasn’t been added?

That would be my guess, yes. You can easily test it by typing the whole address into web browser, including "http://:" - e.g, "http://google.com" - and see if your browser switches to https.

 

With https, it is not possible to use "localhost" any more as the https certificate validation will fail. You can only use the actual domain name for which your certificate has been issued.

 

Dan

 

———

I've worked around (not only) SSL security for over 20 years in enterprises and startups. 

I am now running an HTTPS expiry management service KeyChest.net

Ok I will give this a try. So if that were to work, I have a subdomain hosted on the same server that will actually be the one making the inbound request.!!Then I have a reverse proxy set up to call as local host and then switch back to the subdomain for the response. Would I still be able to do that? Would I add the subdomain to the hosts file or anything?

The localhost reverse proxy should still work. Response from a subdomain ... so long as it's fully behind the reverse proxy ... should be ok as well. 

 

It's fairly common to have https on the perimeter (which would be your main https domain), terminated on the web server, with everything inside the perimeter, e.g., reverse proxies, using plain http. 

 

... but everything can get easily complicated 🙂

 

 

View solution in original post