nginx rewrite for 2 blogs? (1 post)

  1. Vinta
    Posted 7 years ago #

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

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

Topic Closed

This topic has been closed to new replies.

About this Topic