TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.35k stars 563 forks source link

Add X-Real-IP / X-Forwarded-For to nginx docker config #3222

Closed bjo81 closed 1 month ago

bjo81 commented 2 months ago

Is your feature request related to a problem? Please describe.

With the current config, only the nginx-IP is visible to the webapp:

::ffff:172.26.0.4 - - [18/Jul/2024:12:32:06 +0200] "GET /service-worker.js HTTP/1.0" 200 39291 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"

Describe the solution you'd like

Add

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

to the config.

Describe alternatives you've considered

No response

Additional context

No response

vabene1111 commented 1 month ago

Thanks for the idea. The thing is I really hate changing anything in the installation process because every time in the past I have done so some edge case came up that broke things. This leads me to the question: what benefit does this change have? The application works without from what I know and most people will have a reverse proxy which typically sets these variables. If one does not have a reverse proxy setup its easy to change the nginx config according to personal preferences.

So is it necessary to make this change in the default config?

bjo81 commented 1 month ago

I thought using nginx as reverse proxy is somehow a requirement for the official supported version. If not and I can use traefik directly to the app itself, it's not needed.