#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_connections1024;} 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_timeout0;Keepalive_timeout 65;#gzip on;client_max_body_size 8M;Client_body_buffer_size 128k;Server {Listen80;server_name Frontend.dev;CharSet utf-8;#access_log Logs/host.access.log Main;Root e:/xampp/htdocs/html5/php/yii-advanced-app-2.0.6/advanced/frontend/web;Index index.php;Location /{try_files $uri $uri/index.php? $args; } #error_page404/404.html;# REDIRECT Server error pages to the static page/50x.html # Error_page502 503 504/50x.html;Location =/50x.html {root HTML;} # Proxy The PHP scripts to Apache listening on127.0.0.1:80# #location ~ \.php$ {# Proxy_pass/HTTP /127.0.0.1;#} # Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000# location ~ \.php$ {Fastcgi_pass127.0.0.1:9000;Fastcgi_param script_filename $document _root$fastcgi_script_name;Include Fastcgi_params;Try_files $uri =404;} # Deny access to. htaccess files,if Apache ' s document Root # concurs with Nginx's one # #location ~/\.ht {# deny All ; #} } server {Listen80;server_name Backend.dev;CharSet utf-8;#access_log Logs/host.access.log Main;Root e:/xampp/htdocs/html5/php/yii-advanced-app-2.0.6/advanced/backend/web;Index index.php;Location /{try_files $uri $uri/index.php? $args; } #error_page404/404.html;# REDIRECT Server error pages to the static page/50x.html # Error_page502 503 504/50x.html;Location =/50x.html {root HTML;} location ~ \.php$ {Fastcgi_pass127.0.0.1:9000;Fastcgi_param script_filename $document _root$fastcgi_script_name;Include Fastcgi_params;Try_files $uri =404;} # Deny access to. htaccess files,if Apache ' s document Root # concurs with Nginx's one # #location ~/\.ht {# deny All ; #} } # Another virtual host using mix of ip-, name-,and port-based configuration # #server {# listen8000;# Listen somename:8080;# server_name Somename alias Another.alias;# location/{# root HTML;# index Index.html index.htm;#} #} # HTTPS Server # #server {# listen443 SSL;# server_name localhost;# ssl_certificate Cert.pem;# Ssl_certificate_key Cert.key;# Ssl_session_cache shared:ssl:1m;# ssl_session_timeout 5m;# ssl_ciphers high:!anull:! MD5;# ssl_prefer_server_ciphers on;# location/{# root HTML;# index Index.html index.htm; # } #} }
Deploying Yii 2.0\yii-advanced-app-2.0.6 with Nginx