server {
listen ;
server_name ha.d51v.cn;
#access_log /data/wwwlogs/access_nginx.log combined;
root /data/wwwroot/demo/wechat_center/public;
index index.html index.htm index.php;
#error_page /.html;
#error_page /.html;
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
location ~ /\.ht {
deny all;
}
#################以下是Nginx自定义配置的#######################
location / {
try_files $uri $uri/ /index.php?$query_string;
} if (!-d $request_filename)
{
rewrite ^/(.+)/$ /$ permanent;
} # 去除index action
if ($request_uri ~* index/?$)
{
rewrite ^/(.*)/index/?$ /$ permanent;
} # 根据laravel规则进行url重写
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$ last;
break;
}
#error_page /50x.html;
location = /50x.html {
root html;
}
}

最新文章

  1. AngularJs之七
  2. 【总结】详细说说@Html.ActionLink()的用法
  3. c#的学习
  4. java 7-nio异步I/O-将来式和回调式
  5. Spring的AOP与代理
  6. CentOS6.5 一键部署运行环境shell脚本
  7. css中>,+,~的用法
  8. [Windows Server] 在 Windows Server 2012 上安裝 .NET Framework 3.5 - 摘自网络
  9. VB.NET版机房收费系统---七仙女之系统登录
  10. Spring Tool Suit 在Eclipse上的安装
  11. 修改 “嗨加游-Prefix.pch” 或者 “嗨加游-Info.plist ” 方法
  12. nginx配置ssl加密(单双向认证、部分https)
  13. 基于visual Studio2013解决面试题之0209最大堆排序
  14. ArcGIS API for JavaScript 4.2学习笔记[3] 官方第二章Mapping and Views概览与解释
  15. Java实现GB2312文件转UTF8文件
  16. [Usaco2015 Jan]Grass Cownoisseur Tarjan缩点+SPFA
  17. 关于本地化(localization)
  18. AXI
  19. CrawlSpider爬取拉钩
  20. 随机森林和GBDT

热门文章

  1. JavaScript进阶 - 第7章 JavaScript内置对象
  2. mysql实现rownum方法
  3. vue -- key的特殊作用
  4. JMeter(7) 优化判断返回类型和返回值
  5. c#字符串字面量
  6. (转)nginx限制上传大小和超时时间设置说明/php限制上传大小
  7. Spring连接数据库
  8. css3的transform ,2D变换
  9. ParallelsDesktop安装DOS7.1并与MAC共享文件
  10. 多段图动态规划dp