Welcome! Log In Create A New Profile

Advanced

Re: Running nginx as reverse proxy with Apache, rewrite problem

March 18, 2011 04:30PM
Try:

Server {
server_name site.com;
listen 80;
root /path/to/regular/content/;
if ($http_user_agent ~* (mobile|android|blackberry|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|opera\smini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|wap|webos|windows\sce) ) {
rewrite ^ http://mobile.site.com$request_uri redirect;
}
location /xyz/ {
...
}
}

Server {
server_name mobile.site.com;
listen 80;
root /path/to/mobile/content/;
if ($http_user_agent !~* (mobile|android|blackberry|brew|htc|j2me|lg|midp|mot|netfront|nokia|obigo|openweb|opera\smini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|wap|webos|windows\sce) ) {
rewrite ^ http://site.com$request_uri redirect;
}
location /xyz/ {
...
}
}
Subject Author Posted

Running nginx as reverse proxy with Apache, rewrite problem

shellcrash March 18, 2011 02:42PM

Re: Running nginx as reverse proxy with Apache, rewrite problem

Dayo March 18, 2011 04:30PM

Re: Running nginx as reverse proxy with Apache, rewrite problem

António P. P. Almeida March 18, 2011 07:46PM

Re: Running nginx as reverse proxy with Apache, rewrite problem

shellcrash March 19, 2011 08:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready