[SOLVED] Forward wordpress through proxmox

Tyresa

New Member
Mar 20, 2021
9
1
1
31
Hello everyone,

I'm struggling for quite some time now with something that shouldnt be that hard I guess haha.

I have this Proxmox server running and I'm running a virtual machine, ubuntu server with wordpress installed.

Proxmox server has public ip and VM has private IP, Vm is able to access internet just fine.

I can access the wordpress site just fine from the Private IP range but cant access it from the public ip range.

I tried several things but I cant get it to work.. see attachments for interface settings.

Any help/tips would be appreciated.

2022_05_20_15_12_55_Proxmox1_Proxmox_Virtual_Environment_Mozilla_Firefox.png
 
What you need to do is port forwarding as well. You can add this line to the interfaces file

Code:
iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to-destination <ip of wordpress vm>
 
Hello,

Thank you for your input but I still have some troubles.

is this syntax correct '--to-destination 192.168.1.100' ?

When I enter the site URL I can see that I'm trying to connect to the Proxmox host but still unable to connect
 
looks good to me your destination. Do you know on which port wordpress is running, maybe its is something different then 80
 
When I run a netstat -tulpn | grep LISTEN i get the following output.

2.png

I'm not really sure if I'm reading this output correctly but I noticed that there only is a "tcp6 :::80", which means its only listening port 80 for IPv6?
 
yes I would interpret it also that it is only listening to IPv6. You could try to disable ipv6 and restart the service or VM, or check the wordpress config.
 
And in case you are planning to host multiple webservices using multiple VMs/LXCs but with the same public IP you might want to have a look at a "reverse proxy". If you are also running docker somewhere you could for example have a look at the "Nginx Proxy Manager" Container. That one is a bit more user-friendly because of the webui and it can do stuff like refreshing SSL certificates and so on too.
 
Seems like my proxmox host is not listening on port 80 or 443.

I tried opening port 80 and 443 via webgui but seems like it not working, also tried disabling firewall at all, but still wont let me connect.

Has any one a command that might open port 80 and 443?

1653130935525.png
 
auto lo iface lo inet loopback auto eno1 iface eno1 inet static address xxx.xxx.xxx.60/24 gateway xxx.xxx.xxx.254 auto vmbr0 iface vmbr0 inet static address 192.168.1.1/24 bridge-ports none bridge-stp off bridge-fd 0 post-up echo 1 > /proc/sys/net/ipv4/ip_forward post-up iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eno1 -j SNAT --to-source xxx.xxx.xxx.60 post-down iptables -t nat -D POSTROUTING -s 192.168.1.0/24 -o eno1 -j SNAT --to-source xxx.xxx.xxx.60 post-up iptables -t nat -A PREROUTING -i eno1 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.100 post-down iptables -t nat -D PREROUTING -i eno1 -p tcp --dport 80 -j DNAT --to-destination 192.168.1.10 post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1 post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

this should work for you
 
  • Like
Reactions: Tyresa

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!