php - For the same domain name, can Nginx be assigned to different websites based on directories?
世界只因有你
世界只因有你 2017-07-01 09:12:04
0
1
764

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...

NginxHow 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;
}
世界只因有你
世界只因有你

reply all(1)
女神的闺蜜爱上我

Yes, through virtual directory

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!