[SOLVED] Redirect Proxmox Web GUI

  • Thread starter Thread starter Mister X
  • Start date Start date
M

Mister X

Guest
Hello,

i installed Proxmox on my dedicated server. Now i added a lets encryt ssl certificate for the domain linked to the server. I want to redirect users entering the proxmox web gui via the servers ip to the domain. For example via htaccess. But i do not now how to get this done.

So https://myip:8006/ redirects to https://proxmox.mydomain.tld:8006/
 
Last edited by a moderator:
When an IP is put into the address bar of a browser like Chrome/FF/etc, it will always use the address rather than do a reverse DNS. Also, a lot of DNS do not support reverse DNS, or it isn't configured/enabled/working.
Or, you can move the server to a different IP and have a redirection from IP -> new name...
 
I would suggest that you limit Proxmox to localhost:8006 and do a revery proxy in your Apache configuration. Then you can configure Apache to do the redirecting for you. Proxmox itself is IMHO not able to do redirecting.
 
  • Like
Reactions: Mister X
Hello.

You can use HAProxy to achieve that, I wrote a tutorial on how to redirect a subdomain to another webserver (in this case, your proxmox GUI):
http://freedif.org/redirect-a-subdomain-to-a-vm-with-haproxy/

You need to adapt it to redirect a subdomain to your proxmox IP & port. On my server, I used Proxmox internal IP on vmbr1 and port 8006. I closed access to port 8006 from the public interface for security reasons.

I also used let's encrypt to generate certificates for my subdomains:

Generate certificates (you can have one certificate for multiple subdomains):

Code:
./letsencrypt-auto certonly --standalone -d domain.com -d subdomain1.domain.com -d subdomain2.domain.com ....


Regroup them in one file:

cat /etc/letsencrypt/live/domain.com/fullchain.pem /etc/letsencrypt/live/domain.com/privkey.pem > /etc/haproxy/letsencrypt/domain.com

And modify frontend in HAproxy config file to look for the certificate:

Code:
bind *:443 ssl crt /etc/haproxy/letsencrypt/

Good luck !
 
  • Like
Reactions: Mister X