[Nginx] - PHP+FPM相关的配置
CodeIgniter的配置:
worker_processes ; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout ;
fastcgi_connect_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
fastcgi_buffer_size 128k;
fastcgi_buffers 128k;#
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
#gzip on; server {
listen ;
#server_name localhost; location / {
root html;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$uri&$args;
} location ~ \.php$ {
include fastcgi_params;
root html;
fastcgi_pass 127.0.0.1:;
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;
}
} }
ThinkPHP配置:
worker_processes ; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout ;
fastcgi_connect_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
fastcgi_buffer_size 128k;
fastcgi_buffers 128k;#
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
#gzip on; server {
listen ;
#server_name localhost; location / {
root html;
index index.php index.html index.htm;
#try_files $uri $uri/ /index.php?$uri&$args;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$ last;
break;
}
} location ~ \.php$ {
#include fastcgi_params;
include fastcgi.conf;
root html;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
} }
Laravel配置:
worker_processes ; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout ;
fastcgi_connect_timeout 300s;
fastcgi_send_timeout 300s;
fastcgi_read_timeout 300s;
fastcgi_buffer_size 128k;
fastcgi_buffers 128k;#
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
#gzip on; server {
listen ;
#server_name localhost;
root /usr/local/nginx/html/public;
index index.html index.php; location / {
try_files $uri $uri/ /index.php$is_args$query_string;
} location ~ \.php$ {
try_files $uri =;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
前提是要启动PHP的FPM(默认端口为9000):
/usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf
[Nginx] - PHP+FPM相关的配置的更多相关文章
- Nginx的配置中与流量分发相关的配置规范:
1.除首页外,其他页面都在某个目录中首页可以直接在根目录下,其他页面都要在根目录下的目录中.不同的location尽量使用第一个dir的模式进行区分,便于区分该流量是落在nginx本地,还是转发到后端 ...
- Nginx http相关常用配置总结
Nginx http相关常用配置总结 by:授客 QQ:1033553122 测试环境 nginx-1.10.0 client_max_body_size Syntax: client_ma ...
- Linux centos VMware Nginx防盗链、Nginx访问控制、Nginx解析php相关配置、Nginx代理
一.Nginx防盗链 配置如下,可以和上面的配置结合起来 location ~* ^.+\.(gif|jpg|png|swf|flv|rar|zip|doc|pdf|gz|bz2|jpeg|bmp|x ...
- Nginx搭建与相关配置
目录 一.Nginx简介 1.1 概述 1.2 Nginx与Apache的差异 二.编译安装Nginx服务 2.1 将nginx软件包传到主机/opt目录下 2.2.安装依赖包 2.3.添加模块编译安 ...
- 深入理解PHP之:Nginx 与 FPM 的工作机制
网络上有很多关于如何配置 Nginx + FPM 的文章,但它们更多从操作的角度出发,告诉我们怎么做,但却没有告诉我们为什么要这么做,本文从 Nginx 与 FPM 的工作机制出发,探讨配置背后的原理 ...
- HappyAA服务器部署笔记1(nginx+tomcat的安装与配置)
这是本人的服务器部署笔记.文章名称叫"部署笔记1"的原因是之后我对这个进行了改进之后,会有"部署笔记2","部署笔记3"...循序渐进,估计 ...
- Nginx负载均衡的详细配置及使用案例详解.
感谢看过这一些列博文和评论的小伙伴, 我把自己所看到的学到的拿到这里来分享是想和大家一起学习进步, 想听听园友给出的意见, 也是对自己学习过程的一个总结. 技术无止境, 我们仍需努力! 1,话不多说, ...
- Windows下Nginx Virtual Host多站点配置详解
Windows下Nginx Virtual Host多站点配置详解 此教程适用于Windows系统已经配置好Nginx+Php+Mysql环境的同学. 如果您还未搭建WNMP环境,请查看 window ...
- 记录一次自己对nginx+fastcgi(fpm)+mysql压力测试结果
nginx + fastcgi(fpm) 压力测试: CentOS release 5.9 16核12G内存 静态页面: 并发1000,压测200秒,测试结果: 系统最大负载5.47 成功响应: 25 ...
随机推荐
- iOS8后core location框架启动定位服务的步骤
1.在使用CoreLocation前需要调用如下函数[iOS 8专用]: iOS 8对定位进行了一些修改,其中包括定位授权的方法,CLLocationManager增加了下面的两个方法: (1)始终允 ...
- centos6虚拟机复制后修改网卡
方法1: 使用vmware创建centos6.4虚拟机, 创建完成后复制该虚拟机, 打开复制的虚拟机发现网卡名字是eth1,而网卡配置文件为eth0,mac地址变了 这时修改网卡配置文件, 删除uui ...
- 我是一只IT小小鸟----读书笔记
人生如同打牌,能抓到一手好牌固然是运气好,但重要的是,你不能靠运气生活,而要琢磨怎样把手上这把看上去“不怎么样的”牌打好. 要了解一种主流的软件开发与运行平台,熟练掌握一种开发工具,这样就具备了进行开 ...
- 谈谈pooling?
使用pooling的目的之一是获取一定的特征不变性,目前用的比较多的是Max..,非线性对于Deep的重要性不用多说,pooling是主要贡献之一,当然少不了relu类的激活函数.pooling还有一 ...
- 一款基于bootstrap的datetimepicker
<!DOCTYPE HTML> <html> <head> <link href="http://netdna.bootstrapcdn.com/t ...
- ssh整合--struts
一 struts(jar+web.xml+struts.xml+Action) 1import min_jars-------struts-2.3.20.3-all(struts2-blank.war ...
- 数据结构与算法分析-AVL树
1.AVL树是带有平衡条件的二叉查找树. 2.AVL树的每个节点高度最多相差1. 3.AVL树实现的难点在于插入或删除操作.由于插入和删除都有可能破坏AVL树高度最多相差1的特性,所以当特性被破坏时需 ...
- day26_网络编程第一天
1.网络通信三要素(掌握) IP 端口号 协议(UPD&TCP) 2.UDP协议与TCP协议各自特点(掌握) UDP 1.不需要建立连接: 2.有数据大小限制,每个 ...
- 用canvas生成二维码
$("#actimg").qrcode({ render: "canvas", //设置渲染方式,有tabl ...
- NSXMLParser解析xml格式
NSXMLParser解析xml格式的数据 用法如下: 首先,NSXMLParser必须继续NSXMLParserDelegate协议 @interface XMLHelper : NSObject ...