Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

Apache with nginx – How Plesk with nginx Processes HTTP Requests

 
administrator guideapache and nginx web servers linuxapache with nginxweb serversapache

To seamlessly integrate nginx with Apache, Plesk uses two additional
Apache modules:

  • mod_aclr2
    This module sets up a handler which runs after handlers of all other
    Apache modules (mod_rewrite, .htaccess related modules, mod_php,
    and so on). Therefore, if the request is for dynamic content,
    mod_aclr2 will never get it as the request will be served by
    upper-level handlers of certain Apache modules (mod_php, mod_perl,
    mod_cgi, and so on). The only exceptions are SSI requests: once they
    reach mod_aclr2, it redirects them to proper handlers. If the request
    is for a static file, mod_aclr2 searches for the exact file location
    on the file system and sends the location to nginx.
  • mod_rpaf or mod_remoteip
    From the point of view of Apache, all of its clients have the same IP
    address - the address of the nginx server (see the diagram above).
    This causes problems for websites and web apps that use client IP
    addresses for authentication, statistic purposes, and so on. mod_rpaf
    (in Apache 2.2) or mod_remoteip (in Apache 2.4) solves the problem by
    replacing the IP address of the nginx server in all requests with
    client IP addresses. In more detail, the module uses the special
    X-Forwarded-For header in which nginx puts the IP address of a
    client.

Let us take a closer look at how Plesk processes requests for static and
dynamic content with the help of these modules.

The sequence of processing an HTTP request for a static file is as
follows (see the diagram):

  1. A client sends a request to a web server.
  2. nginx adds the X-Accel-external (used by mod_aclr2) and
    X-Forwarded-For (which contains the IP address of the client)
    headers to the request and sends the request to Apache.
  3. Apache receives the request and starts to process it by registered
    handlers (applies .htaccess configuration, rewrites URL, and so
    on). In this step, mod_rpaf replaces the IP address of the nginx
    server in the REMOTE_ADDR Apache variable with the client’s address
    from the X-Forwarded-For header.
  4. After the request is processed by all registered handlers, it reaches
    mod_aclr2. The handler checks for the X-Accel-external header
    presence. If the header is present, the module sends to nginx a
    response with zero content length and the X-Accel-Redirect header.
    This header contains the exact location of the file as determined by
    mod_aclr2.
  5. Once nginx receives the response, it locates the file and delivers it
    to the client.

The diagram below is an example of how Plesk handles a request for a 2
KB GIF file.

<…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Your Complete .htaccess Guide: Including .htaccess Basics and More

Read More »

NGINX vs Apache – Which Is the Best Web Server in 2024?

Read More »

NGINX Configuration Guide

Read More »
Knowledge Base

Optimizing Apache Web Server – Setting Up the Apache Restart Interval

Read More »

IIS Web Server Settings – Common Settings

Read More »

IIS Web Server Settings – Directory Security Settings

Read More »

Apache with nginx – Installing nginx

Read More »

Hosting Wiki

  • Server Redundancy
  • htaccess
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • JavaScript
  • HTTP/3
  • HTTP/2
  • Lighttpd
  • Apache Tomcat
  • NGINX
  • Apache
  • Web Server
  • DNS Server
  • IPv6
  • IPv4
  • SIP
  • UDP/IP
  • URL
  • TCP/IP
  • HTTP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family