How to send request to Ubuntu Server VM from public network?

Mkkk

New Member
Jun 5, 2024
13
0
1
I have set up a yaml file in folder '/etc/netplan' following the template:
network:
version: 2
ethernets:
eth0:
dhcp4: false
addresses:
- my public ip from 'curl ipinfo.io/ip'
gateway4: my gateway ip from 'ip route | grep default', e.g. it is 192.168.1.1 for log "default via 192.168.1.1 dev eth0"
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4

Also, I have set my nginx as

server {
listen 80;

server_name my_public_ip;

location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

I am sure my FastAPI server (hosted with Gunicorn and Nginx) works when I change the "my_public_ip" to the private IP address ('192.168.50.136') shown in VM summary page of the Proxmox UI.

I am still not able to send requests to my running server "my_public_ip_addr:80" ;_;

This is the summary of my Ubuntu 24.04 Server Virtual Machine

1717988620616.png
The first IP is my public ip from 'curl ipinfo.io/ip'.

Do I need to create another Network -> Linux Bridge? e.g. another CIDR, Gateway etc... or make any Proxmox setup?

I am new to this, can anyone please help? Thank you!

I didnt setup ufw firwall
sudo ufw status
Status: inactive
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!