Welcome! Log In Create A New Profile

Advanced

Serving XHTML as HTML to MSIE browsers in NginX

April 06, 2009 12:35AM
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!
Subject Author Posted

Serving XHTML as HTML to MSIE browsers in NginX

elliottcable April 06, 2009 12:35AM

Re: Serving XHTML as HTML to MSIE browsers in NginX

elliottcable April 06, 2009 03:39AM

Re: Serving XHTML as HTML to MSIE browsers in NginX

Maxim Dounin April 06, 2009 05:06AM

Re: Serving XHTML as HTML to MSIE browsers in NginX

elliottcable April 06, 2009 05:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 192
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready