Skip to content

help: local server ports show up in the URL served to users #1465

Answered by mrneutron42
mrneutron42 asked this question in Q&A
Discussion options

You must be logged in to vote

It did turn out that the nginx web server needed a configuration tweak.

I discovered that if I added a trailing slash to the links in my pages, they worked!
It turns out that NGINX web server redirects to port 8080 when the link URL doesn't have a trailing slash.
This is explained here: https://serverfault.com/questions/227742/prevent-port-change-on-redirect-in-nginx

I found that adding "absolute_redirect off;" or "port_in_redirect off;" or both to the server section of the /etc/nginx/sites-available/default file fixes the problem, and :8080 does not get inluded in URLs served to the users.

server {
        listen 8080 default_server;
        absolute_redirect off;
        port_in_redirec…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@chaptergy
Comment options

Comment options

You must be logged in to vote
1 reply
@chaptergy
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by mrneutron42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants