I'm trying to configure my server to serve XHTML files to MSIE browsers as text/html.
Here's the three things I've tried; all of them yell at me about a syntax error, so I can't launch my server:
[code]
location ~* \.(xhtml|xhtm) {
if ($http_user_agent ~* MSIE) {
types { }
default_type text/html
}
}
[/code]
[code]
if ($http_user_agent ~* MSIE) {
location ~* \.(xhtml|xhtm) {
types { }
default_type text/html
}
}
[/code]
[code]
includes.conf:
if ($http_user_agent ~* MSIE) {
include /srv/conf/nginx/msie.conf;
}
msie.conf:
location ~* \.(xhtml|xhtm) {
types { }
default_type text/html
}
[/code]
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:
[code]
if (-f …)
[/code]
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!