DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

fixxxer's picture

Unregistered

Feeds

aliases

  • fixxxer

fixxxer

1 year ago

in NginX Reporting for Duty on Random Musings
>Specifically, if can’t be used within a regular expression based if test, even if you aren’t using variable substitution in the proxy_pass itself.

It seems that you just should not use if()s in nginx.conf for such kind of things, it is rather slow and not intended for request-uri case handling; it is supposed to be used in specific cases like user-agent checks etc.

use regexp locations instead.

to avoid copy-pasting, put some directives to the server{} level, or use the include directive.
1 reply
hadar's picture
hadar Good to know! There are cases where the logic could/would be simpler with if's, but I hear ya. Thanks for sharing!
Returning? Login