Closed icpz closed 1 year ago
Thank you for your suggestion, we will improve this configuration on the next release.
I think it would make sense to replace all X-Forwarded headers:
- proxy_set_header Forwarded "for=$remote_addr;proto=$scheme";
+ proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for;proto=$http_x_forwarded_proto";
- proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
- proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
See https://github.com/haiwen/seafile-docker/issues/91#issuecomment-524914187
Hello, I'm in situation to put docker services behind a custom nginx frontend. This frontend will set the correct
X-Forwarded-For
header, but it's override by the nginx inside the docker image here.Could you please replace that line with:
This will prevent the existing
X-Forwarded-For
from being changed, and set it to $remote_addr if not exist.