1
Web Proxy Filtering and Caching / Re: nginx + csrf token issues with reverse proxy
« on: February 25, 2022, 02:30:40 pm »
Hi again,
I meanwhile solved the problem with the help of mitmproxy to inspect the headers.
As it turns out nginx rewirtes several headers to lower-case. In my case the header field X-XSRF-TOKEN was changed to x-xsrf-token which caused the problem within the webapp.
I hot-fixed the problem by including
in the /usr/local/opnsense/service/templates/OPNsense/Nginx/location.conf template.
Is saw that the generated nginx.conf contains includes for each location in the form of:
Would you suggest to create that directory and put an include config there myself? Do you know of any other ways to have nginx not change the case of header-fields?
Edit: it appears that client <-> nginx is using http2 and nginx <-> webapp is using http 1.1. As http2 requires headers in lowercase format chrome actually sends them in lower case.... aye.
thx
Dark-Sider
I meanwhile solved the problem with the help of mitmproxy to inspect the headers.
As it turns out nginx rewirtes several headers to lower-case. In my case the header field X-XSRF-TOKEN was changed to x-xsrf-token which caused the problem within the webapp.
I hot-fixed the problem by including
Code: [Select]
proxy_set_header X-XSRF-TOKEN $http_x_xsrf_token;
in the /usr/local/opnsense/service/templates/OPNsense/Nginx/location.conf template.
Is saw that the generated nginx.conf contains includes for each location in the form of:
Code: [Select]
include <guid>_post/*.conf;
Would you suggest to create that directory and put an include config there myself? Do you know of any other ways to have nginx not change the case of header-fields?
Edit: it appears that client <-> nginx is using http2 and nginx <-> webapp is using http 1.1. As http2 requires headers in lowercase format chrome actually sends them in lower case.... aye.
thx
Dark-Sider