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

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







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

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