0

I have configured nginx to act as a reverse proxy to forward traffic to an application server running Liferay, nginx is listening on a non standard HTTP port, the page does not load properly whenever I access nginx through the non standard HTTP port (it loads properly if I use port 80), Chrome keeps loading net::ERR_CONNECTION_TIMED_OUT errors while loading certain static files.

I appreciate your help.

1 Answers1

0

http typically listens only on port 80, with https on port 443. If you want nginx to work on another port you can configure another server block to do that. This is completely non standard.

This is an absolute basic of web servers. You need to do some reading. Suggest you also use better grammar when you post to SF.

Tim
  • 31,888
  • 7
  • 52
  • 78
  • I have already created a server block which is listening on 8080, the problem is that the page partially loads, some elements do not load properly. The URL in the browser is configured on port 8080, when I load Google Chrome console I keep receiving net::ERR_CONNECTION_TIMED_OUT errors when some CSS files are loaded since the request sent on port 80, I believe if it is a server block issue then the entire page would not load properly. – codesquared Jan 24 '17 at 13:53
  • Nginx doesn't decide where requests are sent and it doesn't rewrite HTML to change the port that static resources point at based on its listen port. Just because you load the page from port 8080 that doesn't mean the browser will load all the resources from the same port. This is most likely a problem with your web page coding. The solution will be to change your web page to have it load resources from your desired port. – Tim Jan 24 '17 at 18:26
  • Unfortunately I am unable to change the code, is there a solution for this problem that can be done via Nginx? – codesquared Jan 26 '17 at 07:38
  • Not that I know of. You can run your site on http/80 or https/443, you can change your application to generate links to the non-standard port, or you can find some tool that rewrites all your html. There's probably an Apache module that'd do it, it's a bit of a swiss army knife. – Tim Jan 26 '17 at 08:06