Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7773081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:02:34+00:00 2026-06-01T17:02:34+00:00

When acting as a reverse proxy, apache adds x-forwarded headers as described here. http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers

  • 0

When acting as a reverse proxy, apache adds x-forwarded headers as described here.

http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers

In my configuration I have configured server A as a forward proxy. There is a rule like this:

RewriteRule proxy:(.*example.com)/(.*) $1.mysecondserver.com/$2 [P]

This rule lets the server request the resource from one of my other servers.

On the second server (origin) I have a virtual host container for the resource and another rewrite rule like this:

RewriteRule some-regex some-url [P]

It may not seem to make sense like this but there is a lot of other stuff going on that I left out as it is not part of the problem.

However that final request has these headers:

[X-Forwarded-For] => ip of 1st server
[X-Forwarded-Host] => example.myseconserver.com
[X-Forwarded-Server] => example.com

I want those headers gone.

I seem to be unable to unset them with mod_headers. I can add more entries to them, but I can not remove them.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:02:35+00:00Added an answer on June 1, 2026 at 5:02 pm

    corrected answer: there is no way to do that since its hardcoded

    to fix this in the source code of mod_proxy_http.c search for the following part:

        apr_table_mergen(r->headers_in, "X-Forwarded-Server",
                     r->server->server_hostname);
    }
    

    and immediately after that add this code:

    // remove any X-Forwarded headers
    apr_table_unset(r->headers_in, "X-Forwarded-For");
    apr_table_unset(r->headers_in, "X-Forwarded-Host");
    apr_table_unset(r->headers_in, "X-Forwarded-Server");
    

    then compile by running apxs2 -cia mod_proxy_http.c

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have nginx acting as a reverse proxy to apache. I now need to
I have nginx setup, acting as a reverse proxy to apache. However, I need
I have a website set up with nginx acting as a reverse proxy to
Is SearchString acting as property of Page class? Here is code, <%@ Page Language=C#
I have some code acting as an HTTP client which supports basic authentication as
My script is acting strange. After a foreach loop, the script stops. I don't
I have a UISlider acting as the scrubber. As the thumb is dragged I
Google Chrome is acting buggy using border-radius, background color, and top and bottom borders.
My VS 2008 seems to be acting a bit weird and the solution is
Some assertions in my code just started acting strangely, and I was wondering if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.