• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
车车大人
博客园    首页    新随笔    联系   管理     

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/控制器/方法名?参数=

通往牛逼的路上,在意的只有远方!
posted @ 2016-10-10 10:24  车车大人  阅读(620)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3