nginx as proxy server

Denis F. Latypoff denis at gostats.ru
Tue May 20 17:03:13 MSD 2008


Hello Kaushal,

Tuesday, May 20, 2008, 7:12:45 PM, you wrote:

> On Tue, May 20, 2008 at 5:24 PM, Denis F. Latypoff <denis at gostats.ru> wrote:

>> Hello Kaushal,
>>
>> Tuesday, May 20, 2008, 6:10:56 PM, you wrote:
>>
>> > Hi
>>
>> > Is there a documentation on setting up nginx as proxy server
>>
>> http://wiki.codemongers.com/NginxConfiguration
>>
>> > Thanks and Regards
>>
>> > Kaushal
>>
>>
>>
>>
>> --
>> Best regards,
>>  Denis                            mailto:denis at gostats.ru
>>
>>
>>

> Hi Denis

> Thanks for the quick reply

> I have this in the "nginx.conf" file and have restarted ngnix. Basically I
> want to set it as a simple proxy server

>         location / {
>             root   /var/www/example/htdocs;
>             index  index.html index.htm;
              error_page 404 = @proxy;
>         }

          location @proxy {
              proxy_pass http://localhost:8000;
              proxy_set_header Host $host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          }

> Am i missing some thing

don't forget to handle X-Real-IP header in your backend (mod_rpaf for
apache 2.x, or mod_realip for Apache 1.3)

> Thanks and Regards

> Kaushal

-- 
Best regards,
 Denis                            mailto:denis at gostats.ru






More information about the nginx mailing list