Nginx.conf
#user nobody;
Worker_processes 1;
#error_log Logs/error.log;
#error_log Logs/error.log Notice;
#error_log Logs/error.log Info;
#pid Logs/nginx.pid;
Events {
Worker_connections 1024;
}
HTTP {
Include Mime.types;
Default_type Application/octet-stream;
#log_format Main ' $remote _addr-$remote _user [$time _local] "$request" '
# ' $status $body _bytes_sent ' $http _referer '
# ' "$http _user_agent" "$http _x_forwarded_for" ';
#access_log Logs/access.log Main;
Sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
Keepalive_timeout 65;
#gzip on;
server {
Listen 80;
server_name localhost;
#charset Koi8-r;
#access_log Logs/host.access.log Main;
#root E:/xampp/htdocs/html5/php/yii2-rest-master/rest/web;
Root E:/xampp/htdocs/html5/php/yii-basic-app-2.0.5/basic/web;
Index index.php;
Location/{
Try_files $uri $uri//index.php? $args;
}
#error_page 404/404.html;
# REDIRECT Server error pages to the static page/50x.html
#
Error_page 502 503 504/50x.html;
Location =/50x.html {
root HTML;
}
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;
}
}
}
Description: After starting PHP, Nginx, use the browser to access the http://localhost/can
Reference: Installation YII-YII 2.0 authoritative Guide-documentation-YII Framework Chinese Community
PHP for windows/php-5.6.11-win32-vc11-x64 startup script
Deploying Yii 2.0\yii-basic-app-2.0.5 with Nginx