WebFaction
Community site: login faq

So i've been googling and reading around, and I dont yet understand whats going on, the path that a request from a user travels. I'm not an expert and I would love if someone could clarify things a bit (Still a student). It looks like it reaches a nginx process first that sends static request to the static app and dynamic requests to the real app (apache2 + mod_wsgi -> django), and thats why the requests remote_addr are set with 127.0.0.1? Or who is acting like a proxy here causing that remote_addr gets 127.0.0.1? Besides that:

I find the solution of adding a middleware quite poor, it means that I have to add some code to my app, to fix something that is specific of a lower layer. So reading around I found this, which suggests using mod_rpaf for apache, now that sounds more logical to me, to make apache take care of that issue for me before reaching the wsgi application. Which brings me to the question how to install mod_rpaf? besides the question of why this happens in the first place (above). And if there is a better solution to deal with this!

Thanks a lot for any reply or clarification, cheers!

asked 25 Jul '13, 17:01

Agustin
325
accept rate: 0%

edited 25 Jul '13, 17:03


As you noted, the reason you see 127.0.0.1 for REMOTE_ADDR is that every request to your back-end Apache is proxied through our front-end Nginx.

If you want to use mod_rpaf instead of adding middleware to your deployment configuration (not your app, by the way), you can do so by adding the following lines to your app's httpd.conf:

LoadModule rpaf_module        /usr/lib/httpd/modules/mod_rpaf.so
RPAFenable On
RPAFproxy_ips 127.0.0.1 10.0.0.1

Then, just restart your Apache.

Hope that helps!

permanent link

answered 25 Jul '13, 17:32

seanf
12.2k42136
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×910
×25
×25
×1
×1

question asked: 25 Jul '13, 17:01

question was seen: 3,504 times

last updated: 25 Jul '13, 17:32

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM