Attempting to access Nginx from www (public internet network)

18 views Asked by At

I have Nginx running successfully on my local network. Before I proceed with the question, here are the IP addresses:

  1. Ubuntu Server Local IP Address: 192.168.29.110

  2. Internet IPv4 IP Address: 45.8.202.88 (ports forwarded: 80, 443)

Here is my Netplan config file:

network:
  ethernets:
    eno1:
      addresses:
      - 192.168.29.110/24
      nameservers:
        addresses:
        - 8.8.8.8
        search: []
      routes:
      - to: default
        via: 192.168.29.1
  version: 2

I am able to see Nginx landing page successfully on 192.168.29.110 on local area network but I get connection error when visiting dedicated IP address of my internet (45.8.202.88) What changes do I have to make to my Nginx config file as well as my Netplan? Here is my Nginx config file:

server {
    listen 80;
    listen [::]:80;

    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;

    server_name 45.8.202.88;

    location / {
        proxy_pass http://192.168.29.110;  # Update this line
        include proxy_params;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

Ports 80/443 are open as check on port checker. Also, ufw firewall is disabled on the Ubuntu server. Another side note, this dedicated IPv4 internet IP address is from a connected VPN. My ISP doesn't allow port forwarding and dedicated IP address, so I had to grab one from a VPN.

Thanks.

0

There are 0 answers