Home  >  Q&A  >  body text

How to bind multiple ports to nginx?

Port 80 has been successfully bound to nginx and the website opens normally.

Now I want to add another 8080 port binding, what should I do? I've searched Baidu and tried 2 things without success. I haven't slept all night and I'm a little tired, so I'd like to ask everyone here for advice. Thank you!

高洛峰高洛峰2714 days ago396

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 17:13:30

    Just write multiple listens in the server configuration section, such as:
    listen 192.168.0.2:80;
    listen 192.168.0.2:8080;

    reply
    0
  • Cancelreply