OPNsense Forum

English Forums => General Discussion => Topic started by: baz on January 13, 2023, 06:22:50 AM

Title: How to set X-Forwarded-For with nginx plugin?
Post by: baz on January 13, 2023, 06:22:50 AM
I am trying to integrate seafile, and one of the config requirements under `server` is to set `X-Forwarded-For` like so:

```
server {
    proxy_set_header X-Forwarded-For $remote_addr;
}
```

When I check the config generated by the ngnix plugin here at `/usr/local/etc/nginx/nginx.conf`I am unable to find the setting under `server` and I am unsure where in the GUI to find it.

Any ideas?
Title: Re: How to set X-Forwarded-For with nginx plugin?
Post by: Fright on January 13, 2023, 07:32:57 AM
plugin adds this header at the Location context
https://github.com/opnsense/plugins/blob/09ca8eec2401988ec72ae4c2f80fa623c4e8d12f/www/nginx/src/opnsense/service/templates/OPNsense/Nginx/location.conf#L164
Title: Re: How to set X-Forwarded-For with nginx plugin?
Post by: baz on January 13, 2023, 05:41:57 PM
Thank you.