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

    I have 2 blogs:
    https://domain.com/blog on /var/www/nginx-default/blog
    and
    https://domain.com/blog2 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.