nginx won't listen on non-standard port The Next CEO of Stack OverflowNginx redirecting domain to port 8000 with a 301403 Forbidden nginx (nginx/1.8.0)nginx sending 499 response to uptimerobot?CodeIgniter nginx rewrite rules for i8ln URL'sNginx still redirects even though I removed the rule from the confBest practice to handle default_server and public ip in nginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?nginx won't redirect http to httpsNginx reverse proxy to many local servers + webserver duty

Multi tool use
Multi tool use

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

Is HostGator storing my password in plaintext?

Anatomically Correct Strange Women In Ponds Distributing Swords

How to count occurrences of text in a file?

How can I open an app using Terminal?

Need some help with wall behind rangetop

Grabbing quick drinks

What do "high sea" and "carry" mean in this sentence?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Why were Madagascar and New Zealand discovered so late?

When airplanes disconnect from a tanker during air to air refueling, why do they bank so sharply to the right?

Why didn't Khan get resurrected in the Genesis Explosion?

How do I solve this limit?

How long to clear the 'suck zone' of a turbofan after start is initiated?

Can the Reverse Gravity spell affect the Meteor Swarm spell?

Inappropriate reference requests from Journal reviewers

How to write the block matrix in LaTex?

Failed to fetch jessie backports repository

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Was a professor correct to chastise me for writing "Prof. X" rather than "Professor X"?

Visit to the USA with ESTA approved before trip to Iran

Natural language into sentence logic

Shade part of a Venn diagram

How should I support this large drywall patch?



nginx won't listen on non-standard port



The Next CEO of Stack OverflowNginx redirecting domain to port 8000 with a 301403 Forbidden nginx (nginx/1.8.0)nginx sending 499 response to uptimerobot?CodeIgniter nginx rewrite rules for i8ln URL'sNginx still redirects even though I removed the rule from the confBest practice to handle default_server and public ip in nginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?nginx won't redirect http to httpsNginx reverse proxy to many local servers + webserver duty










0















My organization has a server that is just for handling redirects of retired sites (redirects-myorg.org). We've just retired a website (widgets.org), and I am adding the retired site to our redirects server. About a week ago, we had the CNAME record for widgets.org changed so that it points to redirects-myorg.org.



Most of the URLs that were in circulation for widgets.org looked something like: widgets.org:8180/more/info. The 8180 port was explicitly included in the URL.



Success looks like:



  • Typing widgets.org into a browser: redirects to blue-server.com.

  • Typing widgets.org:8180 into a browser: redirects to purple-server.com

(For additional context: Three other sites' redirects are managed on this redirects server, and their configuration files reference ports 80 and 443. None of those sites use non-standard ports like 8180.)



Attempts



1.
I first set up the nginx configuration files to list to ports 80 and 8180 and return a 301 redirect on each:



server 
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;

server
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser: redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

2.
Tried switching the order, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;

server
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;



Result:



  • Same as above.

3.
Tried tricking nginx, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org:8180;
return 301 https://purple-server.com;



Result:



  • Typing widgets.org into a browser: "Welcome to nginx!" page. Not so good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

4.
Tried tricking nginx a different way, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
rewrite ^:8180.* https://purple-server.com break;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser hangs and eventually times not. Not so good.









share|improve this question







New contributor




relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Did you restart nginx after making the changes? Is nginx actually listening on that ports? Are any errors about the ports in the log files of nginx?

    – Gerald Schneider
    19 hours ago






  • 1





    Please be aware that a Permanent Redirect (a redirect with HTTP response code 301) is exactly that: permanent. Such a redirect will be cached by all common web browsers. - If you made a mistake in your server configuration and don't clear your caches (or don't do each new test in a new anonymous/incognito/private window) then any changes you make in the server configuration won't become apparent as your webbrowser will both use the stale cached redirect and change the request you enter in the URL bar for you even before it gets sent to a server.

    – HBruijn
    19 hours ago











  • Did you check if the port is opened by nginx? Can you show the output of netstat -anp | grep :8180

    – unNamed
    19 hours ago











  • Also note that a timeout usually points to a firewall issue. Since all your requests to 8180 time out I assume that you forgot to open the port in your firewall.

    – Gerald Schneider
    19 hours ago











  • That's a firewall problem, most likely. Go there first.

    – Michael Hampton
    18 hours ago















0















My organization has a server that is just for handling redirects of retired sites (redirects-myorg.org). We've just retired a website (widgets.org), and I am adding the retired site to our redirects server. About a week ago, we had the CNAME record for widgets.org changed so that it points to redirects-myorg.org.



Most of the URLs that were in circulation for widgets.org looked something like: widgets.org:8180/more/info. The 8180 port was explicitly included in the URL.



Success looks like:



  • Typing widgets.org into a browser: redirects to blue-server.com.

  • Typing widgets.org:8180 into a browser: redirects to purple-server.com

(For additional context: Three other sites' redirects are managed on this redirects server, and their configuration files reference ports 80 and 443. None of those sites use non-standard ports like 8180.)



Attempts



1.
I first set up the nginx configuration files to list to ports 80 and 8180 and return a 301 redirect on each:



server 
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;

server
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser: redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

2.
Tried switching the order, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;

server
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;



Result:



  • Same as above.

3.
Tried tricking nginx, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org:8180;
return 301 https://purple-server.com;



Result:



  • Typing widgets.org into a browser: "Welcome to nginx!" page. Not so good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

4.
Tried tricking nginx a different way, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
rewrite ^:8180.* https://purple-server.com break;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser hangs and eventually times not. Not so good.









share|improve this question







New contributor




relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Did you restart nginx after making the changes? Is nginx actually listening on that ports? Are any errors about the ports in the log files of nginx?

    – Gerald Schneider
    19 hours ago






  • 1





    Please be aware that a Permanent Redirect (a redirect with HTTP response code 301) is exactly that: permanent. Such a redirect will be cached by all common web browsers. - If you made a mistake in your server configuration and don't clear your caches (or don't do each new test in a new anonymous/incognito/private window) then any changes you make in the server configuration won't become apparent as your webbrowser will both use the stale cached redirect and change the request you enter in the URL bar for you even before it gets sent to a server.

    – HBruijn
    19 hours ago











  • Did you check if the port is opened by nginx? Can you show the output of netstat -anp | grep :8180

    – unNamed
    19 hours ago











  • Also note that a timeout usually points to a firewall issue. Since all your requests to 8180 time out I assume that you forgot to open the port in your firewall.

    – Gerald Schneider
    19 hours ago











  • That's a firewall problem, most likely. Go there first.

    – Michael Hampton
    18 hours ago













0












0








0








My organization has a server that is just for handling redirects of retired sites (redirects-myorg.org). We've just retired a website (widgets.org), and I am adding the retired site to our redirects server. About a week ago, we had the CNAME record for widgets.org changed so that it points to redirects-myorg.org.



Most of the URLs that were in circulation for widgets.org looked something like: widgets.org:8180/more/info. The 8180 port was explicitly included in the URL.



Success looks like:



  • Typing widgets.org into a browser: redirects to blue-server.com.

  • Typing widgets.org:8180 into a browser: redirects to purple-server.com

(For additional context: Three other sites' redirects are managed on this redirects server, and their configuration files reference ports 80 and 443. None of those sites use non-standard ports like 8180.)



Attempts



1.
I first set up the nginx configuration files to list to ports 80 and 8180 and return a 301 redirect on each:



server 
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;

server
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser: redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

2.
Tried switching the order, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;

server
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;



Result:



  • Same as above.

3.
Tried tricking nginx, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org:8180;
return 301 https://purple-server.com;



Result:



  • Typing widgets.org into a browser: "Welcome to nginx!" page. Not so good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

4.
Tried tricking nginx a different way, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
rewrite ^:8180.* https://purple-server.com break;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser hangs and eventually times not. Not so good.









share|improve this question







New contributor




relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












My organization has a server that is just for handling redirects of retired sites (redirects-myorg.org). We've just retired a website (widgets.org), and I am adding the retired site to our redirects server. About a week ago, we had the CNAME record for widgets.org changed so that it points to redirects-myorg.org.



Most of the URLs that were in circulation for widgets.org looked something like: widgets.org:8180/more/info. The 8180 port was explicitly included in the URL.



Success looks like:



  • Typing widgets.org into a browser: redirects to blue-server.com.

  • Typing widgets.org:8180 into a browser: redirects to purple-server.com

(For additional context: Three other sites' redirects are managed on this redirects server, and their configuration files reference ports 80 and 443. None of those sites use non-standard ports like 8180.)



Attempts



1.
I first set up the nginx configuration files to list to ports 80 and 8180 and return a 301 redirect on each:



server 
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;

server
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser: redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

2.
Tried switching the order, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
return 301 https://blue-server.com;

server
listen 8180;
listen [::]:8180;
server_name widgets.org;
return 301 https://purple-server.com;



Result:



  • Same as above.

3.
Tried tricking nginx, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org:8180;
return 301 https://purple-server.com;



Result:



  • Typing widgets.org into a browser: "Welcome to nginx!" page. Not so good.

  • Typing widgets.org:8180 into a browser: hangs and eventually times not. Not so good.

4.
Tried tricking nginx a different way, unsuccessfully:



server 
listen 80;
listen [::]:80;
server_name widgets.org;
rewrite ^:8180.* https://purple-server.com break;
return 301 https://blue-server.com;



Result:



  • Typing widgets.org into a browser redirects to blue-server.com. Good.

  • Typing widgets.org:8180 into a browser hangs and eventually times not. Not so good.






nginx port 301-redirect






share|improve this question







New contributor




relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 20 hours ago









reliztrelizt

1




1




New contributor




relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






relizt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Did you restart nginx after making the changes? Is nginx actually listening on that ports? Are any errors about the ports in the log files of nginx?

    – Gerald Schneider
    19 hours ago






  • 1





    Please be aware that a Permanent Redirect (a redirect with HTTP response code 301) is exactly that: permanent. Such a redirect will be cached by all common web browsers. - If you made a mistake in your server configuration and don't clear your caches (or don't do each new test in a new anonymous/incognito/private window) then any changes you make in the server configuration won't become apparent as your webbrowser will both use the stale cached redirect and change the request you enter in the URL bar for you even before it gets sent to a server.

    – HBruijn
    19 hours ago











  • Did you check if the port is opened by nginx? Can you show the output of netstat -anp | grep :8180

    – unNamed
    19 hours ago











  • Also note that a timeout usually points to a firewall issue. Since all your requests to 8180 time out I assume that you forgot to open the port in your firewall.

    – Gerald Schneider
    19 hours ago











  • That's a firewall problem, most likely. Go there first.

    – Michael Hampton
    18 hours ago

















  • Did you restart nginx after making the changes? Is nginx actually listening on that ports? Are any errors about the ports in the log files of nginx?

    – Gerald Schneider
    19 hours ago






  • 1





    Please be aware that a Permanent Redirect (a redirect with HTTP response code 301) is exactly that: permanent. Such a redirect will be cached by all common web browsers. - If you made a mistake in your server configuration and don't clear your caches (or don't do each new test in a new anonymous/incognito/private window) then any changes you make in the server configuration won't become apparent as your webbrowser will both use the stale cached redirect and change the request you enter in the URL bar for you even before it gets sent to a server.

    – HBruijn
    19 hours ago











  • Did you check if the port is opened by nginx? Can you show the output of netstat -anp | grep :8180

    – unNamed
    19 hours ago











  • Also note that a timeout usually points to a firewall issue. Since all your requests to 8180 time out I assume that you forgot to open the port in your firewall.

    – Gerald Schneider
    19 hours ago











  • That's a firewall problem, most likely. Go there first.

    – Michael Hampton
    18 hours ago
















Did you restart nginx after making the changes? Is nginx actually listening on that ports? Are any errors about the ports in the log files of nginx?

– Gerald Schneider
19 hours ago





Did you restart nginx after making the changes? Is nginx actually listening on that ports? Are any errors about the ports in the log files of nginx?

– Gerald Schneider
19 hours ago




1




1





Please be aware that a Permanent Redirect (a redirect with HTTP response code 301) is exactly that: permanent. Such a redirect will be cached by all common web browsers. - If you made a mistake in your server configuration and don't clear your caches (or don't do each new test in a new anonymous/incognito/private window) then any changes you make in the server configuration won't become apparent as your webbrowser will both use the stale cached redirect and change the request you enter in the URL bar for you even before it gets sent to a server.

– HBruijn
19 hours ago





Please be aware that a Permanent Redirect (a redirect with HTTP response code 301) is exactly that: permanent. Such a redirect will be cached by all common web browsers. - If you made a mistake in your server configuration and don't clear your caches (or don't do each new test in a new anonymous/incognito/private window) then any changes you make in the server configuration won't become apparent as your webbrowser will both use the stale cached redirect and change the request you enter in the URL bar for you even before it gets sent to a server.

– HBruijn
19 hours ago













Did you check if the port is opened by nginx? Can you show the output of netstat -anp | grep :8180

– unNamed
19 hours ago





Did you check if the port is opened by nginx? Can you show the output of netstat -anp | grep :8180

– unNamed
19 hours ago













Also note that a timeout usually points to a firewall issue. Since all your requests to 8180 time out I assume that you forgot to open the port in your firewall.

– Gerald Schneider
19 hours ago





Also note that a timeout usually points to a firewall issue. Since all your requests to 8180 time out I assume that you forgot to open the port in your firewall.

– Gerald Schneider
19 hours ago













That's a firewall problem, most likely. Go there first.

– Michael Hampton
18 hours ago





That's a firewall problem, most likely. Go there first.

– Michael Hampton
18 hours ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






relizt is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f960402%2fnginx-wont-listen-on-non-standard-port%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








relizt is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















relizt is a new contributor. Be nice, and check out our Code of Conduct.












relizt is a new contributor. Be nice, and check out our Code of Conduct.











relizt is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f960402%2fnginx-wont-listen-on-non-standard-port%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







bU,irTL6Mq51
xPgi vOOcbi1NZ8n67ciwyqnGSn7CrKso,ihc,xn,do riY Yh Z7aG

Popular posts from this blog

RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020