• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Question Setup reverse proxy(apache2 or nginx)

TheDanniCraft

New Pleskian
I've running a server with backend that should be accesed with an reversed proxy.
I've created a new .conf file in /etc/apache2/sites-availabe then I entered the following config:
<VirtualHost _default_:80> ServerName panel.example.com ProxyPreserveHost On ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ RewriteEngine on RewriteCond %{HTTP:Upgrade} websocket [NC] RewriteCond %{HTTP:Connection} upgrade [NC] RewriteRule .* ws://localhost:8080%{REQUEST_URI} [P] </VirtualHost>
and copied it into /etc/apache2/sites-enabled.
Then I restarted apache.

But when I open the url only the deafault page appeared.

Now ive seen that Plesk has a nginx reverse proxy pluggin. I downloaded and installed it.
Only in the folder where the nginx files are located, the corresponding order(sites-availibe and sites-enabled) is missing.

Now I do't know how to setup the reverse proxy.
 

Attachments

  • 52CE1553-DA26-4CDD-B6FA-34341E203383.jpeg
    52CE1553-DA26-4CDD-B6FA-34341E203383.jpeg
    407.4 KB · Views: 11
I would recommend you to setup the reverse proxy without plugin, as it is easier.
Just go into the "additional apache and nginx settings" for your (sub)domain and enter the following to the "additional nginx directives" (at the bottom):
Code:
location / {
    proxy_pass http://127.0.0.1:9091/;
}
Just replace the 127.0.0.1 with your target server's ip and the 9091 with the desired port.

Don't forget to set up a ssl certificate on the target server too, without your data will be transferred between your plesk server and the target server unencrypted (which isn't bad if you limit the access to the port only to your plesk server by the firewall).
 
I would recommend you to setup the reverse proxy without plugin, as it is easier.
Just go into the "additional apache and nginx settings" for your (sub)domain and enter the following to the "additional nginx directives" (at the bottom):
Code:
location / {
    proxy_pass http://127.0.0.1:9091/;
}
Just replace the 127.0.0.1 with your target server's ip and the 9091 with the desired port.

Don't forget to set up a ssl certificate on the target server too, without your data will be transferred between your plesk server and the target server unencrypted (which isn't bad if you limit the access to the port only to your plesk server by the firewall).
This gives me this error:
Ungültige nginx-Konfiguration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/panel.thedannicraft.de/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
 
This gives me this error:
Ungültige nginx-Konfiguration: nginx: [emerg] duplicate location "/" in /var/www/vhosts/system/panel.thedannicraft.de/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
Sorry, I forgot to mention you have to disable the "Proxy mode" within the additional apache & nginx settings" (a little above).
 
Back
Top