Score:0

Why does Nginx only respond on Port 80?

br flag

I tried to change nginx' port 80 to 81 in nginx.conf file but my sample site is not responding despite listening to port 81. The sample website only responds on port 80. Also , sample site on http://localhost:81 is responding. But http://samplesite.com/ is not responding when Nginx is running on 81 Port.I am newbie so I'm having a hard time figuring out the best way to do this. Can somebody tell me how I can run Nginx server on a different port than 80 like 81?

Nginx.conf file:

server {
    listen 81;
    listen [::]:81;

    root /var/www/samplesite.com;

    index index.html index.htm index.nginx-debian.html;

    server_name samplesite.com www.samplesite.com;

    location / {
        try_files $uri $uri/ =404;
    }

}

enter image description here

Not: ufw is inactive

4snok avatar
es flag
Sounds like a firewall issue. Can you tell us more about your setup - distro name, are there firewalls between your server and client? Please add output of `iptables -S` command
Nikita Kipriyanov avatar
za flag
Or, I think is better `iptables-save`. In case your system uses nftables, `nft list tables` and then we'll tell which tables you need to review. Also, are you sure you're requesting http://samplesite.com:81/ and not just http://samplesite.com/ ?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.