nginx完美支持yii2框架


nginx完美支持yii2框架

server {
listen 80;
server_name www.peita.net peita.net;
# default_server;
access_log /data/wwwlogs/www.peita.net_nginx.log combined;
index index.html index.htm index.php;
include /usr/local/nginx/conf/wordpress.conf;
root /data/wwwroot/pet/backend/web;
if ($host != www.peita.net) {
rewrite ^/(.*)$ $scheme://www.peita.net/$1 permanent;
}

location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
}

 

改完后的框架訪問路由改為:www.peita.net/控制器/方法名       或者    www.peita.net/控制器/方法名?參數=


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM