Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
21.1 Legacy Series
»
NGINX headers for single Location
« previous
next »
Print
Pages: [
1
]
Author
Topic: NGINX headers for single Location (Read 1719 times)
utahbmxer
Newbie
Posts: 42
Karma: 0
NGINX headers for single Location
«
on:
April 28, 2021, 07:44:53 am »
Hi
Using the WAF/NGINX for a few different apps and it's been awesome! One thing I am looking to figure out is how can we add specific headers for a single Location via the GUI? I am working on getting the
notifications
working for Bitwarden_rs which uses websockets for a specific location/path to route to another port on the backend server.
I need to add the following for /notifications/hub:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
I was able to create the location as needed and then edit /usr/local/etc/nginx/nginx.conf manually and reload the service, but I would rather not have to do this each time I make a change. I noticed the notifications are working without, but would be nice to include them.
TIA!
Logged
Fright
Hero Member
Posts: 1777
Karma: 164
Re: NGINX headers for single Location
«
Reply #1 on:
April 28, 2021, 06:51:59 pm »
Hi
if you on 21.1.5
nginx.conf conatains hooks in location blocks for additional directives
like " include 072b5e24-3c80-42be-ac33-ad55e41e4aa7_post/*.conf;"
so you can try to create dir in /usr/local/etc/nginx and put a .conf-file with your directives there
«
Last Edit: April 28, 2021, 06:53:39 pm by Fright
»
Logged
utahbmxer
Newbie
Posts: 42
Karma: 0
Re: NGINX headers for single Location
«
Reply #2 on:
April 29, 2021, 05:38:57 am »
Oh, I see what you mean. However I see a pre and a post include in the main server block, but nothing inside the individual Location blocks, or am I missing something? It would be nice if the location did so I could add a directive to a single [Existing] location which has various WAF Polcies and other settings already applied from the GUI. I guess I could hack something together by creating a unused Location so it creates the upstream (unless all upstreams are added regardless), etc. and then duplicate it into a new hook. Thoughts?
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
21.1 Legacy Series
»
NGINX headers for single Location