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

  • SEARCH
  • Home
  • 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 6849909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:03:26+00:00 2026-05-27T01:03:26+00:00

In nginx, how can you set up your proxy_pass so it sends to correct

  • 0

In nginx, how can you set up your proxy_pass so it sends to correct client remote ip address? Currently, only the server’s ip shows up. I know that the proper way to do this is

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;

However, on the other end I have a support system that is not written by me. I don’t want to change all the code to fit the X-Forwarded-For parameter.

How can I tell nginx to send the $remote_addr in the format so that it can be read with $_SERVER['REMOTE_ADDR']?

  • 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-05-27T01:03:27+00:00Added an answer on May 27, 2026 at 1:03 am

    proxy_set_header REMOTE_ADDR $remote_addr; don’t work in nginx proxy_pass (link)

    So you must prepare some middleware to your application.
    For example, pseudo-code:

    class RemoteAddrMiddleware(request)
        def process_request(request):
           if request['REMOTE_ADDR'].blank?
               request['REMOTE_ADDR'] = request['X-Forwarded-For']
           end
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To my knowledge Nginx can only password protect directories from within the configuration file(s).
I've set up Nginx as my main web server and have two Mochiweb based
I have a webapp on a NGinx server. I set gzip on in the
in php.ini and nginx configurations, there are limits that can be set which restrict
I just installed Nginx listening on 8083 I can get a HTTP response when
I have nginx all set up for my needs... it's a wildcard directory based
I am setting up a nginx server. I create a user nginx for running
I just set up Nginx for the first time, having liked what I read
i'm trying to setup django on nginx + gunicorn on a centos6 server (firewall
I am using the following configuration for NGinx currently to test my app :

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.