Closed Tirodem closed 2 months ago
It depends on the reverse proxy (apache, nginx) and the forwarded headers.
When placing the beBOP behind a reverse proxy, to get your user's IPs, you will need to set the
ADDRESS_HEADER
toX-Forwaded-For
and theXFF_DEPTH
header to1
(or appropriate value depending on your config) in the environment.
You also need to configure nginx or apache to correctly send the X-Forwarded-For
header
Oh, yeah, good guess, I missed that. I'll try later tonight 👌
It's kinda funny, with this in my .env.local :
ADDRESS_HEADER=X-Forwarded-For
XFF_DEPTH=1
When I do this (after a pm2 tasks reset)
pm2 start --name bebop --update-env build/index.js -f
Or this
pm2 restart all --update-env
It doesn't work
But if I don't put the values in my .env.local then use this command :
ADDRESS_HEADER=X-Forwarded-For XFF_DEPTH=1 pm2 start --name bebop --update-env build/index.js -f
It now works (being on USA through Cyberghost VPN) :
So I'll go with it right now but did I miss something for the .env.local update ?
And, for documentation issues, we have some X-Forwaded-For
instead of X-Forwarded-For
in it.
BTW, I'm unlocked on my pilots.
yes it probably is tricky to make it work with .env.local
for those two variables, setting them in the environment directly is probably best
Currently, on be-BOP, when you go to /checkout and there's an address form, the country is pre-filled with visitor's country IP (except for https://github.com/B2Bitcoin/beBOP/issues/1186 to keep in mind). On local machines and on Nodl cloud env, the behavior is good. On OVH VPS Starter, the displayed country is always "French", even being in Switzerland physically with a confirmed swiss IP (by ip2location), or in USA through a VPN. For VAT purpose, having the IP wrongly detected is bad. We need to check.