Suppose there are three websites on the same serverA
,B
,C
but only one domain namewww.abc.com
Expectation:
Visiting www.abc.com/a
can access the content of the A
website,
Visiting www.abc.com/b
can Access the content of B
website,
visit www.abc.com/c
to access the content of C
website,
and so on...
Nginx
How should it be configured?
My Nginx
is configured like this, but it cannot achieve the desired effect:(
location /a {
root /path/to/web/a;
try_files $uri $uri/ /index.php;
}
location /b {
root /path/to/web/b;
try_files $uri $uri/ /index.php;
}
location /c {
root /path/to/web/c;
try_files $uri $uri/ /index.php;
}
location ~ .*\.php? {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:900;
}