Report this

What is the reason for this report?

Nginx ports (8080)

Posted on May 30, 2013

Hi, I’m configuring nginx and everything seems to work OK, except that it only “listens” to the default port (80). I’m struggling to configure it to listen to port 8080. I’ve tried with “listen 8080;” “listen 127.0.0.1:8080;” “listen localhost:8080;”… but all are ignored.

I made those changes in the sites-enabled file (/etc/nginx/sites-available/mysite). Do I have to change something in nginx.conf or in other file?

Thanks in advance for your help!



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Kamal, I checked and there are some errors, but apparently all related to my CMS (Drupal), not to nginx. <br> <br>Gavin, I haven’t installed any firewall (at least not consciously). <br> <br>Dave, I don’t fully understand what you say (I’m very new to nginx and to sysadmin issues in general) but I think that could be the problem or at least related to that: <br>I have several domains in the same nginx server and therefore several “server declarations” in the same configuration file (all included in /etc/nginx/sites-available/mysite). When I put listen 8080; in the first server declaration (save and restart nginx) and go to that first domain, it redirects to the next domain in the nginx configuration file. <br> <br>Simplifying, it’s something like this: <br> <br>server { <br> listen 8080; <br> server_name www.domain1.com; <br> … <br>} <br>server { <br> listen 80; <br> server_name www.domain2.com; <br> … <br>} <br> <br>With this configuration, when I open www.domain1.com in my browser it redirects me to www.domain2.com. That could be related to what you were talking about? That gives more clues about what could be my problem? <br> <br>Thanks again for all your quick responses!

Are you running a firewall? If you want to connect externally to it, you may have to add a rule in to iptables.

Hi kamaln7. I config Nginx run on port 80 and httpd run on port 8080. But when i test my code on local only apache installed, it’s ok. But when I up code on server, It auto add 8088 to all my link href, hix hixx. This make terible my system. It have error :(.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.