centOS7.4 thinkPHP nginx 支持pathinfo和rewrite
server
{
listen 80;
server_name www.demo.com mayifanx.com;
root /data/www/demo;
index index.php index.html index.htm; #红色部分支持rewrite
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last;
}
} location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #蓝色部分是支持pathinfo
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; }
}
centOS7.4 thinkPHP nginx 支持pathinfo和rewrite的更多相关文章
- [转]Nginx+ThinkPHP不支持PathInfo的解决办法
FROM : http://www.4wei.cn/archives/1001174 应集团要求,公司的服务器全收到集团机房统一管理了,失去了服务器的管理配置权限. 杯具就此开始. 首先要解决文件大小 ...
- nginx支持pathinfo模式
很久不使用apache了,渐渐对apache感到陌生,因为朋友有个ZendFramework框架从apache移到nginx下,需要pathinfo模式支持.网上海搜于是开始搜索nginx+pathi ...
- 配置Nginx支持pathinfo模式
Nginx服务器默认不支持pathinfo, 在需要pathinfo支持的程序中(如thinkphp),则无法支持”/index.php/Home/Index/index”这种网址.网上流传的解决办法 ...
- nginx支持pathinfo并且隐藏index.php
How To Set Nginx Support PATHINFO URL Model And Hide The /index.php/ 就像这样 The URL before setting lik ...
- 使得nginx支持pathinfo访问模式
原理: 任意创建一个 in.php 文件: <?php echo '<pre>'; ...
- 使nginx支持pathinfo模式
在将fastadmin部署到虚拟机中时,遇到如下问题:当访问登录页面时,页面进行不断的循环跳转重定向.解决方法是将nginx配置为支持pathinfo的模式 以下是nginx中的配置内容: locat ...
- 让Nginx支持pathinfo
# 典型配置 location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_ ...
- 让thinkphp 5 支持pathinfo 的 nginx ,去掉index.php
在TP5.0中查阅tp5官方文档,注意:5.0取消了URL模式的概念,并且普通模式的URL访问不再支持.phthinfo 是什么? PHP中的全局变量$_SERVER['PATH_INFO']是一个很 ...
- nginx支持pathinfo
server { root /webserver/www/api; listen ; server_name api.dnxia.com; location / { if (!-e $request_ ...
随机推荐
- Html中编码格式的设置,及引入javascript、css的方法
1.html页面中设置字符编码的格式: <meta http-equiv="Content-Type" content="text/html; charset=ut ...
- 解决Windows 7 IIS7.5 用户 'IIS APPPOOL\{站点名} AppPool'登录失败
今天调试程序的时候,使用VS调试没有任何问题,但是发布到IIS就发生错误了,网上搜索了一下,问题具体上就出在IIS的应用程序池的设置上.我使用的是Windows7 IIS7.5. 错误为:用户 'II ...
- create-trigger-insert-pwd
delimiter | drop trigger if exists default_insert_Pwd; create trigger default_insert_Pwd before inse ...
- Centos7 下Boost 1.61.0源码 配置开发环境
1 下载地址 https://sourceforge.net/projects/boost/files/boost/1.61.0/ boost_1_61_0.tar.gz 2 卸载系统自带的boost ...
- celery中的生产者消费者问题
celery中的生产者消费者问题 在task1.py文件中: # demo1:task.py and celery.py in one file# run it byfrom celery impor ...
- 使用Redis的五个注意事项(命名)
原文:使用Redis的五个注意事项 下面内容来源于Quora上的一个提问,问题是使用Redis需要避免的五个问题.而回答中超出了五个问题的范畴,描述了五个使用Redis的注意事项.如果你在使用或者考虑 ...
- Pycharm在创建py文件时,自动添加文件头注释
依次File -> Settings -> Editor -> File and Code Templates -> Python Script 添加以下代码: # -*- ...
- 正则表达式 - JavaScript描述
正则表达式 - JavaScript描述 概述 正则表达式是被用来匹配字符串中的字符组合的模式.在JavaScript中,正则表达式也是对象. 创建正则表达式 var re = /abc/; // 使 ...
- iOS数据存储到本地的几种方法
A,归档解档(多针对于模型或者数组,利用MJExtension) 1,先在model里的.m文件写上MJCodingImplementation 2,再进行模型归档: #define APP_DOCU ...
- C# 复杂算法
1.添加命名空间引用using Microsoft.JScript; //formula 是公式如:(1+2)*3/10 private double GetComputeValueByStringF ...