Serving XHTML as HTML to MSIE browsers in NginX

elliottcable nginx-forum at
Mon Apr 6 11:39:13 MSD 2009

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: - it also declares that the inside of an `if () {}` declaration should inherit context from outside the `if`: (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?

Posted at Nginx Forum:,839,842#msg-842

More information about the nginx mailing list