server {
listen 80;
server_name sss.cn;
root "root/";
location / {
index index.html index.htm index.php;
if (-f $request_filename/index.html){
rewrite (.) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.
) $1/index.php;
}
if (!-f \(request_filename){ rewrite (.*) /index.php; } #autoindex on; } rewrite /wp-admin\) \(scheme://\)host\(uri/ permanent; location ~ \.php(.*)\) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME \(document_root\)fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED \(document_root\)fastcgi_path_info;
include fastcgi_params;
}

}

记一次nginx配置伪静态规则的更多相关文章

  1. Nginx常用伪静态规则(rewrite)-Discuz X3.2-WordPress-PHPCMS-ECSHOP-SHOPE(转)

    当我们从apache服务器转向Nginx服务器的时候,它们的伪静态规则就不一样了,所以你熟悉Nginx服务器的伪静态规则,自己写当然也好.不了解Nginx服务器的伪静态规则的,为方便各位站长,收集了这 ...

  2. Yii2 nginx配置伪静态

    Yii2 配置 Nginx 伪静态 主要检查以下代码: location / { # Redirect everything that isn't a real file to index.php t ...

  3. Nginx 配置 Location 规则优先级问题

    nginx 的 location与配置中 location 顺序没有关系,与 location 表达式的类型有关.相同类型的表达式,字符串长的会优先匹配. 以下是按优先级排列说明: 等号类型(=)的优 ...

  4. nginx配置伪静态

    最近做门户网站,使用了的nginx重写规则 项目目录下写好 nginx.conf文件 然后在打开nginx配置文件,在server引入对应的重写规则的文件就可以了 当然直接写在配置里面 locatio ...

  5. nginx 配置路由规则转发配置记录

    工作中公司要求针对经销商PC端和工厂PC端的访问地址固定访问. 经销商PC端 http://localhost/ 工厂PC端   http://localhost/fac 文件磁盘路径: /crm/n ...

  6. Nginx配置-伪静态,隐藏index.php大入口

    server { listen ; server_name ; root E:/www/wvtuan/; index index.php index.html; log_not_found off; ...

  7. phpwind伪静态规则(IIS,Nginx,Apache)的介绍及代码

    phpwind iis下伪静态规则[ISAPI_Rewrite]RewriteRule ^(.*)/(.*)-htm-(.*)-(.*).html$ $1/$2.php?$3=$4RewriteRul ...

  8. Nginx 重定向 伪静态 rewrite index.php

    参考https://www.kancloud.cn/manual/thinkphp5/177576 thinkphp入口文件同目录下添加.把下面的内容保存为.htaccess文件 <IfModu ...

  9. PHPwind高级伪静态规则及方法

    phpwind iis下伪静态规则[ISAPI_Rewrite]RewriteRule ^(.*)/(.*)-htm-(.*)-(.*)\.html$ $1/$2\.php\?$3=$4Rewrite ...

随机推荐

  1. Mysql配置查询

    查看mysql数据库的线程数: show global status like 'Thread%'; 如果我们在MySQL服务器配置文件中设置了thread_cache_size,当客户端断开之后,服 ...

  2. oozie 启动过程中--- Existing PID file found during start. Removing/clearing stale PID file.

    如果oozie使用kill -9 暴力杀死了tomcat,再启动的时候,会出问题,需要删除tomcat的pid文件 彻底停止oozie的tomcat的进程,然后删除pid文件 rm -rf  /exp ...

  3. alembic在tornado项目中的应用

    在项目中引用alembic 协助tornado项目生成数据表结构 alembic revision --autogenerate -m "create tables" 第二步执行 ...

  4. Mysql: 开启慢查询日志[ERROR] unknown variable 'log-slow-queries'处理办法

    参考: http://www.dataguru.cn/thread-305503-1-1.html # slow query log qjp 20160921 # mysql5.6版本以上,取消了参数 ...

  5. VS2015安装QT插件

    下载安装完后直接重新启动vs

  6. 51 Nod 1242 矩阵快速幂求斐波那契数列

    #include<bits/stdc++.h> #define mod 1000000009 using namespace std; typedef long long ll; type ...

  7. ImageIO类说明

    最近的项目中遇到ImageIO,因此记录下这个类的用法 一.ImageIO: 这个类中的方法都是静态方法,可以用来进行简单的图片IO操作 1.读入的三种方法 public static Buffere ...

  8. create-react-app创建,ie11不兼容

    按照官方文档使用yarn create react-app centre-app 创建工程,使用yarn start, chrome浏览器可正常访问 但在ie11下报如下图错误 解决方案如下: 1. ...

  9. css实现动态阴影、蚀刻文本、渐变文本

    css实现动态阴影 创建与类似的阴影box-shadow 而是基于元素本身的颜色. 代码实现: <div class="dynamic-shadow-parent"> ...

  10. C++入门经典-例6.19-字符串类型之修改string字符串的单个字符串

    1:头文件 #include <string> 声明一个string变量,形式如下: std::string s; 初始化string类型的变量: std::string s1(" ...