We run a wordpress blog in a subdirectory from our main domain.

domain.com => Server A (Nginx)
domain.com/blog => Server B (Apache)

The blog itself lies on a different (cheap shared hosting) server and gets reverse proxied.

Nginx => Apache

As every request to the blog gets tunneld trough our main server, Server B continuously blocks our Server A IP address, as all requests come from the same IP. If a lot of requests hit at the same time (mostly crawlers) we get blacklisted for 10 minutes and it results in a 502 bad gateway error.

Is there any way to pass the real IP address to Server B? Or knows somebody another solution, without upgrading to a root server? Hosting the wordpress blog on Server A is sadly not an option right now.


If the "cheap shared hosting" supports it, you could forward the original requester IP:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
So hopefully your reverse proxy's IP wont gets blocked.

If you want to block a list of bots you can check this question/answer out:


5 years late.

No. But you can block the crawlers?

if ($http_user_agent ~* bot)
    return 404;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.