Applicable to:
- Plesk for Linux
Question
How to install and enable nginx reverse proxy on a Plesk for Linux server?
Answer
After enabling nginx reverse proxy on a Plesk server, it will be used in combination with Apache. To learn more about how nginx reverse proxy works with Apache, visit the following Plesk documentation page:
-
Install the nginx reverse proxy component:
1.1. Log in to Plesk.
1.2. Go to Tools & Settings and click Updates and Upgrades.
1.3. On the Updates and Upgrades page, click Add/Remove Components.
1.4. On the Add/Remove Components page, expand Web hosting and select Nginx web server for installation. Click Continue to begin the installation.
-
Once the component is installed, enable the nginx reverse proxy service in Plesk:
2.1. Go to Tools & Settings > Services Management.
2.2. Click the
button next to Reverse Proxy Server (nginx) once and wait. The process will take some time to configure.
-
Connect to a Plesk server via SSH.
-
Install the nginx reverse proxy component using the following command:
# plesk installer --select-release-current --install-component nginx
-
Manage nginx reverse proxy:
-
To check the current status of nginx reverse proxy:
# /usr/local/psa/admin/sbin/nginxmng --status
-
To enable the nginx reverse proxy service, run:
# /usr/local/psa/admin/sbin/nginxmng --enable
-
To disable the nginx reverse proxy service, run:
# /usr/local/psa/admin/sbin/nginxmng --disable
Note: The start and stop operations for nginx reverse proxy listed above switch the nginx web-server configuration for all domains in Plesk. This might cause a website downtime for a short period of time.
-
Comments
9 comments
Hola buenas cizaña:
Tengo la versión de Plesk 12.5.3 para windows y no veo Todas Estas options ...
Gracias de antemano y Un saludo ..
Hello Jose Luis Bejar Fernandez,
The article is only applicable for Plesk installed on a Linux server.
There is no possibility to install and enable nginx on a Windows server by Plesk means.
Hello,
I'm running the above script from command line to attempt to install the nginx server to preview my websites, but I get an error message:
"
plesk installer --select-release-current --install-component nginx
Doing restart of Plesk Installer...
BUSY: Update operation was locked by another update process.
exit status 1
"
Any ideas on what would be causing this?
-Daniel
Hello Daniel Salinas
This usually happens when there's another instance of Plesk installer running. For, example, when the installer was launched via GUI it remains running for 30 minutes.
Please, check this article for instructions on how to stop running installer instances.
For Plesk Obsidian there's a dedicated command:
plesk installer stop
Kuzma Ivanov
did you mean "and" and not "end", on "Installing end enabling nginx reverse proxy via the Plesk interface"?
Hello Ehud Ziegelman
Seems to be a typo, fixed.
So after I installed nginx as discribed, I run into this error msg:
New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/nginx.conf:42 nginx: configuration file /etc/nginx/nginx.conf test failed . Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.
the line in the nginx.conf: include /etc/nginx/*global_params;
I tried both "here" and it displayed in both cases that the changes were successful, after refreshing the pleak startpage I get the same error msg again and again.
best
Connor
Your knowledge base version of this page (present at https://www.plesk.com/kb/support/how-to-install-and-enable-nginx-reverse-proxy-on-a-plesk-for-linux-server/) breaks the commands by turning double hyphens into a UTF8 "emdash". I assume other articles also have the same issue.
Hi @Benjamin Hodgetts,
Thanks for noticing!
We've corrected those broken commands.
Please sign in to leave a comment.