[Catalyst-commits] r8713 - trunk/examples/CatalystAdvent/root/2008

jshirley at dev.catalyst.perl.org jshirley at dev.catalyst.perl.org
Thu Dec 4 17:35:53 GMT 2008


Author: jshirley
Date: 2008-12-04 17:35:53 +0000 (Thu, 04 Dec 2008)
New Revision: 8713

Modified:
   trunk/examples/CatalystAdvent/root/2008/2.pod
Log:
Adding proxy headers

Modified: trunk/examples/CatalystAdvent/root/2008/2.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2008/2.pod	2008-12-04 11:52:52 UTC (rev 8712)
+++ trunk/examples/CatalystAdvent/root/2008/2.pod	2008-12-04 17:35:53 UTC (rev 8713)
@@ -181,10 +181,18 @@
 
 This is one of main reasons why I love nginx over Apache.  To switch from
 fastcgi to using prefork, you just have to change one line.  Instead of
-fastcgi_pass, you simply have proxy_pass in its place.
+fastcgi_pass, you simply have proxy_pass in its place and then set the
+proxy headers:
 
-    proxy_pass  http://localhost:3000/;
+    location / {
+        proxy_set_header Host $http_host;
+        proxy_set_header X-Forwarded-Host $http_host;
+        proxy_set_header X-Real-IP $remote_addr;
+        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 
+        proxy_pass  http://localhost:3000/;
+    }
+
 Now, all connections for that location go to your application which is running
 on the built-in server (hopefully with Catalyst::Engine::HTTP::Prefork).  If
 you use this method, you will have to enable the "using_frontend_proxy" option




More information about the Catalyst-commits mailing list