Hacker News new | ask | show | jobs
by jrtc27 1582 days ago
> The if directive is tricky to use, especially in location{} blocks. It often doesn’t do what you expect and can even cause segfaults.

That's not user error. That's lazy programming and a bug. If your code segfaults because of user input you weren't expecting, that's on you as a programmer.

1 comments

It wouldn't surprise me if they consider that WONTFIX given they wrote a whole wiki page entitled "If is Evil": https://www.nginx.com/resources/wiki/start/topics/depth/ifis...
I can understand why certain directives don't work inside an if, even if segfault is dumb.

Why are the empty if blocks breaking things outside of them?

Oh I know. Hardly inspires confidence; all of those examples are clear bugs declared features because of poor programming practices.