M
M
mr_mescaline2017-02-21 17:44:15
Nginx
mr_mescaline, 2017-02-21 17:44:15

nginx+apache+cloudflare proxy pass?

there was a problem with determining ip
there are 2 servers
1) apache + nginx (direct ip without any proxy)
2) apache + nginx (sites behind cloudflare)
on the 1st server there is a counter that looks at the user's IP and writes logs.
on the 2nd set of sites behind cloudflare (loads a .js script from the first server) loads via proxy_pass:
location /file.js {
proxy_pass site.com/file.js;
module mod_realip2 - also installed and configured on both.
set_real_ip_from are also placed (and my second server and cloudflare)
everything seems to work and ip is determined correctly, but it’s worth adding sites (domains) without cloudflare to server 2 (i.e. via dns directly), ip address is written in the logs of a non-user and 2 servers.
I understand I wrote a whole crossword puzzle, but I can’t solve it myself for a week. so I ventured to ask here))
at least approximately where to dig ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2017-02-21
@dimonchik2013

decompose the problem and you will solve everything
, you have only four options, just sort through

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question