Welcome! Log In Create A New Profile

Advanced

Re: nginx + wordpress rewrite question

February 09, 2010 02:38AM
On Tue, Feb 9, 2010 at 2:21 PM, Edho P Arief <edhoprima@gmail.com> wrote:
> wordpress is pretty smart in handling rewrites
>
> here's example for wordpress installation in a root of a domain:
>
> server {
>  listen 80;
>  server_name my.blog.com;
>  location ~ ^/.*\.php$ {
>    root /srv/http/wordpress;
>    fastcgi_pass 127.0.0.1:9100;
>    fastcgi_index index.php;
>    fastcgi_param SCRIPT_FILENAME $request_filename;
>    include fastcgi_params;
>  }
>  location / {
>    index index.php;
>    root /srv/http/wordpress;
>    try_files $uri /index.php;
>    expires max;
>  }
> }
>
>
>

inside a directory, it'd be either:

server {
listen 80;
server_name my.blog.com;
location ~ ^/blog/.*\.php$ {
root /srv/http/wordpress;
fastcgi_pass 127.0.0.1:9100;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
location /blog/ {
index index.php;
root /srv/http/wordpress;
try_files $uri /index.php;
expires max;
}
location = /blog {
rewrite ^ /index.php;
}
}

and then create symlink /srv/http/wordpress/blog pointing to
/srv/http/wordpress;

or

server {
listen 80;
server_name my.blog.com;
location ~ ^/blog/(.*\.php)$ {
alias /srv/http/wordpress/$1;
fastcgi_pass 127.0.0.1:9100;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
location /blog/ {
index index.php;
alias /srv/http/wordpress/;
error_page 404 = /index.php;
expires max;
}
location = /blog {
rewrite ^ /blog/index.php;
}
}


--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx + wordpress rewrite question

Jaime Magiera February 08, 2010 07:12PM

Re: nginx + wordpress rewrite question

Cliff Wells February 08, 2010 07:20PM

Re: nginx + wordpress rewrite question

Hone Watson February 09, 2010 01:04AM

Re: nginx + wordpress rewrite question

Ray February 09, 2010 02:10AM

Re: nginx + wordpress rewrite question

edogawaconan February 09, 2010 02:32AM

Re: nginx + wordpress rewrite question

edogawaconan February 09, 2010 02:38AM

Re: nginx + wordpress rewrite question

merlin corey February 09, 2010 06:40PM

Re: nginx + wordpress rewrite question

edogawaconan February 09, 2010 08:02PM

Re: nginx + wordpress rewrite question

merlin corey February 12, 2010 08:02PM

Re: nginx + wordpress rewrite question

edogawaconan February 12, 2010 10:04PM

Re: nginx + wordpress rewrite question

Jaime Magiera February 16, 2010 07:34AM

Re: nginx + wordpress rewrite question

edogawaconan February 16, 2010 08:34AM

Re: nginx + wordpress rewrite question

Jaime Magiera February 16, 2010 01:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 131
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready