Arc Forumnew | comments | leaders | submitlogin
How do I get the real IP address when Arc is behind nginx?
1 point by lark 4293 days ago | 4 comments
The following certainly isn't enough:

  proxy_set_header  X-Real-IP  $remote_addr;


1 point by akkartik 4292 days ago | link

Wifi is spotty here, but here's all the stuff I have in my config for a past project:

    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Referer $http_referer;
Does that work? If so, can you post the minimal headers needed? Thanks.

-----

1 point by lark 4292 days ago | link

It doesn't work for me.

(pr req!ip) keeps showing the IP address of the server rather than the IP address of the client.

I need a way of telling clients apart. Perhaps I should be looking at cookies instead.

-----

1 point by akkartik 4292 days ago | link

To plumb the X-Forwarded-For IP to req!ip, try the patch at http://www.arclanguage.org/item?id=11199. (See gotcha #3 at https://sites.google.com/site/arclanguagewiki/arc-3_1/known-...)

-----

2 points by lark 4289 days ago | link

Thanks. It seems this should work with Anarki.

-----