I’ve tried everything I can think of at this point. I can’t find
documentation on what’s allowed inside of an if() clause; it just keeps
throwing syntax errors at me.
I’ve also tried googling for other examples of the if() clause; all the
examples I could find only ever used it in this form:
if (-f …)
Is that the only thing the if() clause is useful for?
I’ve got some time sensitive content that needs to get online, and
moreover, be visible to MSIE users (that’s a first for me). I don’t have
the time to re-write my CMS to serve HTML to MSIE either; this should
really be done from the server side anyway. Any help would be much
appreciated!
Okay, I talked to the nice people in the nginx IRC room a bit (thanks
“merlincorey” and “Damn”!). From a more careful reading of the NginX
wiki’s documentation, it appears that this should be legal:
Here’s the reasoning. The wiki declares that the types {} declaration
is legal within a location /…/ {} declaration: http://tr.im/ijbz?nginx
it also declares that the inside of an if () {} declaration should
inherit context from outside the if: http://tr.im/ijbK?nginx (to
quote, “Configuration inside directive if is inherited from the previous
level.”). Therefore, having a types declaration inside an if inside
a location should be legal.
Unfortunately. with the configuration file as linked above, I can’t
launch NginX; I get an “emergency” level error about syntax that kills
it on launch.
Is this a bug, then? Or is the documentation wrong? In either case, what
can I do to get my server fixed to (im)properly serve XHTML to MSIE?
On Mon, Apr 06, 2009 at 03:39:13AM -0400, elliottcable wrote:
Okay, I talked to the nice people in the nginx IRC room a bit (thanks “merlincorey” and “Damn”!). From a more careful reading of the NginX wiki’s documentation, it appears that this should be legal:
Here’s the reasoning. The wiki declares that the types {} declaration is legal within a location /…/ {} declaration: http://tr.im/ijbz?nginx - it also declares that the inside of an if () {} declaration should inherit context from outside the if: http://tr.im/ijbK?nginx (to quote, “Configuration inside directive if is inherited from the previous level.”). Therefore, having a types declaration inside an if inside a location should be legal.
Directives allowed within if() blocks has context “if” or “if in
location” explicitly listed in their documentation. Directives
types and default_type aren’t allowed inside if’s.
Unfortunately. with the configuration file as linked above, I can’t launch NginX; I get an “emergency” level error about syntax that kills it on launch.
Is this a bug, then? Or is the documentation wrong? In either case, what can I do to get my server fixed to (im)properly serve XHTML to MSIE?