How Do I Setup Nginx as a Reverse Proxy in Plesk?

Setting up Nginx as a reverse proxy in Plesk involves several steps, and in this guide, we’ll walk you through the process.

Understanding Reverse Proxy:

A reverse proxy acts as an intermediary between internal applications and external clients. It directs client requests to the appropriate backend Linux VPS server, ensuring proper network traffic flow. Nginx, a free and open-source reverse proxy, also serves as an IMAP/POP3 proxy, enhancing performance by handling static content and forwarding dynamic content requests to the Apache server.

Reasons for Using a Reverse Proxy:

There are several advantages to implementing a reverse proxy:

  1. Balancing the load between multiple servers for improved performance.
  2. Providing a single point of contact for clients, facilitating logging and reporting across multiple servers.
  3. Enhancing privacy.

Why Choose Nginx:

Nginx is recommended for various reasons:

  1. Improved security.
  2. Enhanced performance and load balancing between servers.
  3. Simplified tracking and auditing.
  4. Utilizing TLS for encrypting the connection between the client and the reverse proxy.

Setting up NGINX Reverse Proxy on Plesk Control Panel:

Step 1: Log in to the Plesk account as the root user.

Plesk

Step 2: Navigate to “Tools & Settings,” click on “Plesk,” and choose “Restricted Mode Settings.”

restricted mode settings

Step 3: In the webserver tab, scroll down to find the nginx configuration.

nginx settings

Step 4: Deselect “proxy mode” and add necessary information to “Additional Nginx Directives” before clicking “Apply.” Modify the Server IP in the first line and the server name in the final line.

location / {
proxy_pass http://server_IP:3000;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}

nginx settings

extended nginx directives

additional nginx directives

If you encounter any difficulties during this process, feel free to contact the host.co.in Team for 24×7 proactive support. We trust that this guide provides a clear understanding of setting up Nginx as a reverse proxy in Plesk.