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. H5 2次重定向301

    测试环境http ,生产https,导致请求重定向.加之H5自己的一次请求重定向,一共2次.

  2. BZOJ2306 [Ctsc2011]幸福路径[倍增]

    这个有环的情况非常的讨厌,一开始想通过数学推等比数列的和,但是发现比较繁就不做了. 然后挖掘这题性质. 数据比较小,但是体力可以很接近1(恼怒),也就是说可能可以跳很多很多步.算了一下,大概跳了2e7 ...

  3. k8sService资源

    一.service资源及其实现模型 通过规则定义出由多个pod对象组合而成的逻辑集合,以及访问这组pod的策略.service关联pod资源的规则要借助于标签选择器来完成 1.service资源概述 ...

  4. h5手机页面注册处理(短信验证)

    //获取验证码 var wait = 60; function time(o) { if(wait == 0) { o.removeAttribute("disabled"); o ...

  5. Spring MVC 设置UTF-8编码

    按照需求选其中之一即可吧. 修改读取参数时候的编码: 在web.xml中: 添加一个过滤器(filter),注册 org.springframework.web.filter.CharacterEnc ...

  6. 利用rand7() 产生rand10()(腾讯)

    题目1:已知rand7() 可以产生 1~7 的7个数(均匀概率),利用rand7()  产生rand10()   1~10(均匀概率) int rand10() { int temp; int te ...

  7. Hibernate 缓存机制详细分析

    在本篇随笔里将会分析一下hibernate的缓存机制,包括一级缓存(session级别).二级缓存(sessionFactory级别)以及查询缓存,当然还要讨论下我们的N+1的问题. 随笔虽长,但我相 ...

  8. ubuntu+tomcat+jenkins+git+maven

    1.下载tomcat.jdk和jenkins.war (下面通过wget下载的jdk-8u231-linux-x64.tar.gz不能用,需要本地下载后上传到服务器)解决Linux上解压jdk报错gz ...

  9. jquery keypress() 方法 语法

    jquery keypress() 方法 语法 作用:keypress 事件与 keydown 事件类似.当按钮被按下时,会发生该事件.它发生在当前获得焦点的元素上.不过,与 keydown 事件不同 ...

  10. 分布式-网络通信-线程(socket)

    package OIO; import java.io.IOException; import java.io.InputStream; import java.net.ServerSocket; i ...