Skip to content
Snippets Groups Projects
Commit 3afb106a authored by Nikos Kasioumis's avatar Nikos Kasioumis
Browse files

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.
parent 8626792d
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,12 @@ mv /tmp/src /tmp/src-original ...@@ -18,6 +18,12 @@ mv /tmp/src /tmp/src-original
cd /tmp/src-original/ cd /tmp/src-original/
/opt/rh/rh-python36/root/usr/bin/mkdocs build --clean --site-dir /tmp/src/ /opt/rh/rh-python36/root/usr/bin/mkdocs build --clean --site-dir /tmp/src/
# Configure nginx to not specify the port in absolute redirects.
mkdir /tmp/src/nginx-default-cfg/
cat <<EOF> /tmp/src/nginx-default-cfg/redirect.conf
port_in_redirect off;
EOF
# Go back to the current directory. # Go back to the current directory.
cd $cwd cd $cwd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment