The root (http://www.example.com/) will point to /var/www/wordpress
How can I allow each one to be viewable in browser?
working -- http://www.example.com
error -- http://www.example.com/wordpress2
error -- http://www.example.com/htmlsite
Here is the structure:
first wordpress: /var/www/wordpress
second wordpress: /var/www/wordpress2
static html page: /var/www/htmlsite
server {
root /var/www/wordpress;
index index.php;
...
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location /wordpress2 {
root /var/www/wordpress2;
try_files $uri $uri/ /index.php$is_args$args;
}
location /htmlsite {
root /var/www/htmlsite;
try_files $uri $uri/ =404;
}
}
If I do this root /var/www;
instead, then /wordpress2 and /wordpress3 works:
server {
root /var/www;
index index.php;
...
location / {
try_files $uri $uri/ =404;
}
location /wordpress2 {
try_files $uri $uri/ /wordpress2/index.php$is_args$args;
}
location /wordpress3 {
try_files $uri $uri/ /wordpress3/index.php$is_args$args;
}
location /htmlsite {
root /var/www/htmlsite;
try_files $uri $uri/ =404;
}
}