How to Configure Apache & Nginx Settings in Plesk

In Plesk, Apache and Nginx work together to serve websites.
This configuration section allows you to fine-tune how both web servers handle traffic for each domain.


Step 1: Log in to Plesk

Go to:

https://your-server-ip:8443

Log in with your Plesk credentials.


Step 2: Go to Websites & Domains

  • Click Websites & Domains from the sidebar

  • Select the domain you want to configure


Step 3: Click “Apache & nginx Settings”

Under the domain’s management tools, click Apache & nginx Settings.


Step 4: Configure Web Server Settings

Here you’ll see various customizable settings. The most common and important ones include:


1. Smart Static Files Handling (Nginx)

Enable “Serve static files directly by nginx” for faster loading of:

  • .jpg, .png, .css, .js, .ico, etc.

✅ Recommended for most websites — improves speed and reduces server load.


2. Apache and Nginx Additional Directives

Use these fields to enter custom configuration code for specific behaviors.

  • Additional Apache directives — applies to .htaccess-level configs

  • Additional nginx directives — good for caching rules, redirects, rewrites

Example nginx directive for caching static files:

location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
  expires 30d;
  access_log off;
}

3. Redirects and HTTPS Handling

  • Enable/disable Permanent SEO-safe 301 redirect from HTTP to HTTPS

  • Adjust proxy mode if you want Apache to handle PHP processing

⚠️ Disable Proxy Mode only if using PHP-FPM with Nginx directly.


4. Compression (GZIP/Brotli)

Some Plesk environments allow enabling GZIP compression here or through Performance Boosters or Nginx directives.

To enable manually:

gzip on;
gzip_types text/plain application/javascript application/x-javascript text/css;

5. Security Headers (Optional)

You can add security headers via directives for improved protection.

Example (Apache):

Header always set X-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set Referrer-Policy "strict-origin-when-cross-origin"

Step 5: Save Settings

After making changes, click OK or Apply.

Changes are applied instantly to the selected domain's configuration.


Summary

Setting Purpose
Static file handling Speed up delivery via Nginx
Custom directives Add advanced rules (redirects, caching, security)
HTTPS redirect Force secure browsing
Compression Reduce page size and load time
Security headers Harden your website

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)