[TUTORIAL] How to reverse proxy Proxmox using Plesk

cofifield

New Member
Feb 11, 2022
1
0
1
27
Hello!
I am posting this in hopes that others may find it useful. I currently use Plesk as my web hosting panel. I was looking for a way to reverse proxy Proxmox through Plesk's built in frame forwarding feature as it utilizes NGINX. Unfortunately, the default frame forwarding template Plesk uses is missing some directives that allow the VNC console to work properly. Below I have included a link to my Github repository that contains step by step instruction on how to utilize the new template I have created.

Link to the Github repository

ProxmoxPlesk​

Plesk template file for reverse proxying Proxmox through the built in frame forwarding. This enables properly proxied websocket connections and allows the VNC console to work remotely. This also allows the built in letsencrypt to retain its functionality. This works by directly outputting the user supplied redirect URL into the nginx configuration file instead of using Plesk's built in backend port redirection. It additionally add the required proxy_set_header Upgrade $http_upgrade; and proxy_set_header Connection "upgrade"; directives required to enable the VNC console over a proxied connection. Referenced

Notice​

This might break other frame forwarding setups you already have configured. I haven't tested it with a "standard" proxy connection. You probably shouldn't use this file if you have production services being proxied. This also bypasses any collected webstats.

If you are interested in looking into the changes I have made, the original file is located here: /opt/psa/admin/conf/templates/domain/nginxForwarding.php

Setup​

  1. SSH into your Plesk instance.
  2. Transfer the nginxForwarding.php file to your home user directory
  3. Create the required directories:
sudo mkdir /opt/psa/admin/conf/templates/custom
sudo mkdir /opt/psa/admin/conf/templates/custom/domain
  1. Copy the template file:
sudo cp ~/nginxForwarding.php /opt/psa/admin/conf/templates/custom/domain/nginxForwarding.php
  1. Regenerate the vHost templates:
sudo /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
  1. Configure your domain/subdomain "Hosting Settings" to use frame forwarding
  2. Input your Proxmox web interface address in the "Destination address" field EX: https://192.168.1.x:8006/
  3. Enable SSL/TLS support and Permanent SEO-safe 301 redirect from HTTP to HTTPS in the "Security" settings

Removal​

  1. Remove the custom template directory:
sudo rm -rf /opt/psa/admin/conf/templates/custom
  1. Regenerate the vHost templates:
sudo /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
 
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!