nginx proxy warning

Post Reply
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

nginx proxy warning

Post by Fett »

This is not news but when using nginx as reverse proxy in front of apache there is warning "you are behind proxy".

How exactly can I troubleshoot?

I want to use nginx because its faster than Apache for static files.

I have access to nginx.conf but exactly what code should I insert?

I would need specific instructions and the code.

I Googled but no luck. This is a specific issue to SCJ. Surely someone already troubleshooted this, but cannot find info on this here in this forum either.

In my case

_SERVER["REMOTE_ADDR"] is my home address ...OK
_SERVER["SERVER_ADDR"] is my servers IP ...OK

but I see

HTTP_X_FORWARDED_FOR when I use nginx

But I have no clue what to do. And nginx is compiled with ngx_http_realip_module too.

Using Direct Admin with Custom Build 2 here.

When I use Apache 2.4 event and mod_fcgid, no proxy warning. This is cool but Apache event is inferior to nginx...

Can somebody who already solved this help? Thanks
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: nginx proxy warning

Post by admin »

1. it's not a specific one
HTTP_X_FORWARDED_FOR is a header that mean that a user uses a proxy
So any script that detects proxies will have the same issue
Of course they can just ignore it and show higher proxy % ...


2. check proxy_set_header in nginx config

3. why do you need apache herу, I mean why don't you use php-fpm for example ?
Don't forget to run script update
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: nginx proxy warning

Post by Fett »

I find this line:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

So what to do with it? Delete? Or write something else here?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: nginx proxy warning

Post by admin »

Delete it
Don't forget to run script update
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: nginx proxy warning

Post by Fett »

Thank you for help! Now its perfect!
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: nginx proxy warning

Post by admin »

NP
but i'd move to php-fpm
Don't forget to run script update
Post Reply