As far as I understand it, this is what happens: Step 1:
http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header => "Defines the request header field whose value will be used to replace the client address." So in your config you tell nginx to treat the value of the header " X-Forwarded-For" from the incoming client request as the "real ip". Step 2: Then with "proxy_set_header X-Real-IP $remote_addr;" you tell nginx to send the "fake real ip" from "Step 1" as the value of the header "X-Real-IP" to your Mojo app. Unless you have another reverse proxy in front of your nginx I´d say you should simply remove the "real_ip_header" and "real_ip_recursive" directives from your nginx config and everything should work as expected (as long as you tell your Mojo server that it sits behind a reverse proxy). In any case "$controller->req->headers->header('X-Real-IP')" should now give you the original client IP. HTH - Heiko -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
