I am trying to set up a VPS server (Ubuntu 22.04 LTS) bought from Microsoft. I am able to set up NGINX on my own by watching this tutorial. After setting up all the configs stated in the video I ran nginx -t
to confirm if all the setup was correct. It ran without any error. Now the main concern is in the tutorial it is using Hostinger provider which by default made port 80 public but in my VPS it is not.
After watching few blogs & questions in stack I ran the follow sudo ufw status
command to see if HTTP & NGINX is enabled or not for which I got this.
root@Online-Test-UBUNTU-22-04:/# sudo ufw status
Status: active
To Action From
-- ------ ----
Nginx HTTP ALLOW Anywhere
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
80 ALLOW Anywhere
Nginx Full ALLOW Anywhere
Nginx HTTP (v6) ALLOW Anywhere (v6)
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)
root@Online-Test-UBUNTU-22-04:/#
Below is my custom server config code stored in /etc/nginx/sites-enabled/otp
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name X.X.X.X;
location / {
try_files $uri $uri/=404;
}
}
How can I solve this problem?