There are two projects, one is from phpcms, and the other is from the yii2.0 framework. The server uses nginx. Now I want to take the yii project directly as a subdirectory and then use it through the http://domain.com/ subdirectory. to access, but the index can be accessed through the configuration/subdirectory, but the resource files of the page such as pictures, css, etc. cannot be loaded. The picture link is http://domain.com/subdirectory/public/images/blue_icon.png, but it still does. Redirect to index.php under the subdirectory. What is the problem?
server{
listen 80;
server_name domain.com;
root /Users/xxx/www/project;
index index.php;
location /{
try_files $uri $uri/ /index.php?$args;
autoindex on;
}
location /blog{
index index.php index.html;
try_files $uri $uri/ /blog/index.php?$args;
autoindex on;
}
location ~ ^(.+\.php)(.*)$ {
root /Users/xxx/www/project;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
There are two projects, one is from phpcms, and the other is from the yii2.0 framework. The server uses nginx. Now I want to take the yii project directly as a subdirectory and then use it through the http://domain.com/ subdirectory. to access, but the index can be accessed through the configuration/subdirectory, but the resource files of the page such as pictures, css, etc. cannot be loaded. The picture link is http://domain.com/subdirectory/public/images/blue_icon.png, but it still does. Redirect to index.php under the subdirectory. What is the problem?
server{
listen 80;
server_name domain.com;
root /Users/xxx/www/project;
index index.php;
location /{
try_files $uri $uri/ /index.php?$args;
autoindex on;
}
location /blog{
index index.php index.html;
try_files $uri $uri/ /blog/index.php?$args;
autoindex on;
}
location ~ ^(.+\.php)(.*)$ {
root /Users/xxx/www/project;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}