I just want to set…if $http_user_agent equals AAA or BBB or empty
(“”)…then return 400…Thanks…
if ($http_user_agent ~ (AAA|BBB)) {return 400;}
if ($http_user_agent = "") {return 400;}
Posted at Nginx Forum:
I just want to set…if $http_user_agent equals AAA or BBB or empty
(“”)…then return 400…Thanks…
if ($http_user_agent ~ (AAA|BBB)) {return 400;}
if ($http_user_agent = "") {return 400;}
Posted at Nginx Forum:
Try this:
if ($http_user_agent ~ “^(AAA|BBB|^.+)$”) {return 400;}
^.+ ??
It means empty string?
Posted at Nginx Forum:
^(not).+(one or more of anything)
Can I write like this…?
if ($http_user_agent ~ (AAA|BBB|^$)) {return 400;}
Posted at Nginx Forum:
Yeah, that should work.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs