Support » Fixing WordPress » nginx rewrite for 2 blogs?

  • web server is nginx + fastcgi php + mysql
    blog platform is wordpress

    I have 2 blogs: on /var/www/nginx-default/blog
    and on /var/www/nginx-default/blog2

    here is my current “/etc/nginx/sites-available/default”

    server {
    listen 80;
    server_name localhost;
    root /var/www/nginx-default/;
    access_log /var/log/nginx/localhost.access.log;

    location / {
    index index.html index.htm index.php;
    if (!-e $request_filename) {
    rewrite ^/blog/(.+)$ /blog/index.php?q=$1 last;

    if i use this setting above, blog2 will be “404 not found”
    how to update the “/etc/nginx/sites-available/default” for both blogs under the same directory?

  • The topic ‘nginx rewrite for 2 blogs?’ is closed to new replies.