Having trouble with Web Interface Via Nginx Proxy

husskii

Member
Jun 19, 2022
13
1
8
Hi
I have been trying to get my proxmox server to connect with domain name and no port.
I have followed the wiki guide for Web Interface Via Nginx Proxy i setup my iptables
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8006

i can access my webui via local ip no port but i cant via domain name and no port.

can someone tell me if i am missing something or doing something wrong please.

ive been stuck on this for a fair while now with no luck..

could really use the help
thanks
 
Hello,

Does the domain of your PVE is resolved?

Do you follow our wiki guide [0]?

[0] https://pve.proxmox.com/wiki/Web_Interface_Via_Nginx_Proxy
yes i followed that guide and it does resolve but for some reason i can only access with port number it wont work without it. but when i use local IP i can access without port so im confused as why. and i followed that guide step by step.. ive tried on a number of machines and still no luck. i tried using the nginx proxy manager on a previous setup but that didnt work either, i have my ports open on 8006, 443 and 80 also
 
Hello,

You only need modify nginx file config, Why you using iptables?
I don't see any iptables modification on https://pve.proxmox.com/wiki/Web_Interface_Via_Nginx_Proxy
You are made things more hard in your brain, go step a step and is very easy to do my friend :)
hi originally i tried just the nginx config and that didnt work i tried multiple copies of people using and posting nginx config file for proxmox and none on them worked :( so i thought i would try iptables maybe that will help lol.. have you got it working without port? if so can i have a look at your config by any chance..

below is my conifig file atm. and the setup i followed step by step but no luck and its driving me nuts lol. the only thing i changed was the
listen 443; and removed ssl on; and added to listen 443 ssl; because syntax fails the other way and found that its supposed to be like that now on newer installs. and for

proxy_pass https://localhost:8006;
I have tried using the local and external ip. that didnt help either.

upstream proxmox {
server "pve.mydomain.com";
}

server {
listen 80 default_server;
rewrite ^(.*) https://$host$1 permanent;
}

server {

listen 443 ssl;
server_name _;
ssl_certificate /etc/pve/local/pve-ssl.pem;
ssl_certificate_key /etc/pve/local/pve-ssl.key;
proxy_redirect off;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://localhost:8006;
proxy_buffering off;
client_max_body_size 0;
proxy_connect_timeout 3600s;
proxy_read_timeout 3600s;
proxy_send_timeout 3600s;
send_timeout 3600s;
}
}
 
Hello,

You do not need to edit anything in the config. Just your PVE domain. If the `nginx -t` returns successfully and the status of `nginx.service` is running without any error, that should work. However, I would check if you enable the Firewall and check if port 80 is listening by Nginx, not another service.
 

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!