My configuration:
server {listen 80;server_name www.xxx.com xxx.com;# server_name_in_redirect off;root /alidata/www/default/yooao/frontend/web;location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }location / {index index.php ;root /alidata/www/default/yooao/frontend/web;}location ~ ^/backend$ {index index.php ;root /alidata/www/default/yooao/backend/web;}}
Now is the front desk can go in, backstage but not, I use is yii2 frame. I didn't add it before
`location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }`
When you enter the front page will become the download page. Now I want to match the URL into the background do not know what to do, and now into the background www.xxx.com/backend display 404, novice seeking advice
Reply content:
My configuration:
server {listen 80;server_name www.xxx.com xxx.com;# server_name_in_redirect off;root /alidata/www/default/yooao/frontend/web;location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }location / {index index.php ;root /alidata/www/default/yooao/frontend/web;}location ~ ^/backend$ {index index.php ;root /alidata/www/default/yooao/backend/web;}}
Now is the front desk can go in, backstage but not, I use is yii2 frame. I didn't add it before
`location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }`
When you enter the front page will become the download page. Now I want to match the URL into the background do not know what to do, and now into the background www.xxx.com/backend display 404, novice seeking advice
The official website document explicitly gives how to configure Nginx, the address is: Http://www.getyii.com/doc-2.0/guide/start-installation.html#nginx
If you are using the premium version, after the project is initialized, Frontend,backend needs to be configured separately, that is, to configure two Vhost