Skip to content

Don't specify the port in nginx absolute redirects

  • Include port_in_redirect off; in the default server block for Nginx. Nginx listens to port 8080 by default in Openshift. But the standard public route is on port 80. When Nginx redirects it will append port 8080 to the public route by default, hence leading to a 'server not found' error. port_in_redirect off; instucts Nginx to not specify the port in redirects. An example would be when visiting directories that are served as part of a static site without including a trailing slash (http://server/directory instead of http://server/directory/). Nginx will automatically redirect to the URL with the trailing slash and the port becomes an issue.

Merge request reports

Loading