Stephane Guedon
2021-04-04 08:13:30 UTC
Good day.
I have a setup in OpenBSD 6.8, relayd / httpd and wish to see if I can
have specific http options or headers depending on paths in the requests.
Can I do "match path ..." and set headers ? Until now, all doc I read
say you can set headers globally but not on specific paths.
I can set tags, but trying to match on them and set headers after
triggers syntax error.
Here is an extract of the relayd.conf, where I wish to match on the
static path. I got syntax error when I test this conf (currently
commented) :
http protocol https {
# Various TCP options
tcp { nodelay, sack, socket buffer 65536, backlog 128 }
...
#match path "/static/*" {
#response header set "Access-Control-Allow-Methods" value
"GET,OPTIONS"
#response header set "Access-Control-Allow-Headers" value
"Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-
Modified-Since,Cache-Control,Content-Type"
# }
pass request path "/static/*" forward to <webhosts>
pass request path "/tracker/socket" forward to <apihosts>
pass request path "/socket.io" forward to <apihosts>
pass request path "/*" forward to <apihosts>
}
Thanks for answers.
I have a setup in OpenBSD 6.8, relayd / httpd and wish to see if I can
have specific http options or headers depending on paths in the requests.
Can I do "match path ..." and set headers ? Until now, all doc I read
say you can set headers globally but not on specific paths.
I can set tags, but trying to match on them and set headers after
triggers syntax error.
Here is an extract of the relayd.conf, where I wish to match on the
static path. I got syntax error when I test this conf (currently
commented) :
http protocol https {
# Various TCP options
tcp { nodelay, sack, socket buffer 65536, backlog 128 }
...
#match path "/static/*" {
#response header set "Access-Control-Allow-Methods" value
"GET,OPTIONS"
#response header set "Access-Control-Allow-Headers" value
"Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-
Modified-Since,Cache-Control,Content-Type"
# }
pass request path "/static/*" forward to <webhosts>
pass request path "/tracker/socket" forward to <apihosts>
pass request path "/socket.io" forward to <apihosts>
pass request path "/*" forward to <apihosts>
}
Thanks for answers.