net::ERR_CONNECTION_REFUSED . How to correctly configure Nginx with Socket.io?

Francis Daly francis at daoine.org
Thu Jan 30 18:45:14 UTC 2020


On Thu, Jan 30, 2020 at 08:11:15AM -0500, MarcoI wrote:

Hi there,

> curl on PC-Server (Ubuntu 18.04.03 Server Edition):
> 
> (base) marco at pc:~/vueMatters/testproject$     curl -Iki
> http://localhost:8080/
> HTTP/1.1 200 OK

So from the nginx-and-vue server, you can access vue.

> But from a laptop (Ubuntu 18.04.03 Desktop): 
> - https://drive.google.com/open?id=1r56ZApxg3gQLRakKGCwI7CriQbbmfrLh
> - https://drive.google.com/open?id=1Dm-PC85pjGfqIeMOS45k3hvV9PANgOH5

That seems to show that from a different machine, you can access nginx,
which reverse-proxies to vue; and the content from vue includes links or
redirects to localhost (and to localhost:8080). And those links will fail.

I cannot tell from these pictures what one http request was made and what
response was received -- maybe the output of "curl -vk https://ggc.world"
from this machine will show something?

If the issue is that vue is returning a http 301 or 302 redirect to
something below localhost or localhost:8080, then either changing that
in vue, or adding proxy_redirect in nginx, may be best.

If the issue is that vue is returning a http 200 with content that links
to localhost, then that should be changed in vue.

I suspect that almost anything in the vue config that mentions localhost,
should be removed. But vue people may be a better source of information
there.

Good luck with it,

	f
-- 
Francis Daly        francis at daoine.org


More information about the nginx mailing list