monero-project / monero

Monero: the secure, private, untraceable cryptocurrency
https://getmonero.org
Other
8.88k stars 3.09k forks source link

reverse proxy for rpc? #8362

Open Roki100 opened 2 years ago

Roki100 commented 2 years ago

Hello! I started my node few days ago and i am using nginx for my node now to connect to rpc with wallets, but i have noticed that monerod is not aware of this at all and when i enable log level to 1 each http request is actually an ip of nginx's docker container, is there a way to get monerod to be "aware" of the reverse proxy and recognize real ips via some real ip header? like --reverse-proxy or something?

plowsof commented 2 years ago

Do you have monerod running in a docker container? if so you can force the docker container to have a static ip see here note: this is considered bad practice, but it works for me. and then in nginx something like:

  location /something {
    proxy_pass http://172.20.111.2:8000;
  }
Roki100 commented 2 years ago

Do you have monerod running in a docker container? if so you can force the docker container to have a static ip see here note: this is considered bad practice, but it works for me. and then in nginx something like:

  location /something {
    proxy_pass http://172.20.111.2:8000;
  }

yes it is running in docker container and i have already set up networking properly, proxy_pass https://monerod:18089; but that is not what i asked though, monerod is not aware of being behind a proxy and it doesnt recognize real request ips, so i guess its a bad thing for any sort of anti abuse mechanisms

plowsof commented 2 years ago

sounds like a docker container / networking issue rather than monerod problem? It reminds me of running a tor hidden service* where all ip's are 'localhost', is there a specific issue that this causes? or are you worried about something potentially happening?

Roki100 commented 2 years ago

sounds like a docker container / networking issue rather than monerod problem? It reminds me of running a tor hidden service* where all ip's are 'localhost', is there a specific issue that this causes? or are you worried about something potentially happening?

no its not docker issue, monerod simply does not respect any real ip/forwarded for header