Home  >  Q&A  >  body text

Why does Nginx listen to port 80?


    server {
        listen       80;
        server_name  manage.taotao.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

    proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_connect_timeout 600;
        proxy_read_timeout 600;
        }
        
    }
    

What does listen here mean?

滿天的星座滿天的星座2714 days ago469

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-05-16 17:13:45

    Because the default port of HTTP is 80 and the default port of HTTPS is 443.

    reply
    0
  • PHPz

    PHPz2017-05-16 17:13:45

    This can be modified. The listen port 80 is just the default setting and it is also everyone’s agreement, because the entered domain name or IP defaults to access port 80. It doesn’t need to be displayed

    reply
    0
  • Cancelreply