nginx和php通信
#启动php-fpm服务
#配置nginx.conf
worker_processes ;
worker_rlimit_nofile ;
worker_cpu_affinity ; #error_log logs/error.log;
error_log /data/logs/nginx/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid; events {
use epoll;
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
tcp_nopush on;
server_tokens off; #keepalive_timeout ;
keepalive_timeout ;
gzip on;
gzip_min_length 5k;
gzip_buffers 4 16k;
#gzip_http_version 1.0;
gzip_comp_level 3;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
upstream server_mango {
server 127.0.0.1:;
}
include /usr/local/nginx/conf/vhost/*.conf;
再配置
server{
listen ;
index index.php index.html index.htm;
root /data/wwwroot/www.test.cc;
location / {
if ( $query_string ~ "(<|%3C)") {
return ;
}
if ( !-e $request_filename ) {
rewrite ^/(.*)$ /index.php?s=$ last;
break;
}
}
location "\.(jpeg|jpg|png|gif|css|js|ico|swf)" {
expires 8h;
}
location ~ "\.php$" {
include fastcgi_params;
fastcgi_pass server_mango;
}
}
再编辑:
include fastcgi_params;
添加 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 启动nginx即可
nginx和php通信的更多相关文章
- nginx配置:支持phpfastcgi,nginx和php-cgi通信,部分nginx常量解释
支持phpfastcgi的配置如下: server { listen 8000; server_name localhost; root F:/home/projects/test; i ...
- php与nginx之间的通信
Nginx是俄国人最早开发的Webserver,现在已经风靡全球,相信大家并不陌生.PHP也通过二十多年的发展来到了7系列版本,更加关注性能.这对搭档在最近这些年,叱咤风云,基本上LNMP成了当下的标 ...
- nginx和php-fpm通信的两种方式 unix socket和TCP
nginx和fastcgi的通信方式有两种,一种是TCP 一种是unix socket TCP使用的是 127.0.0.1:9000端口,将fastcgi_pass参数修改为127.0.0.1:900 ...
- nginx配置:支持phpfastcgi,nginx和php-cgi通信,部分nginx常量解释
支持phpfastcgi的配置如下: server { listen 8000; server_name localhost; root F:/home/projects/test; index in ...
- 【转】nginx 和 php-fpm 通信使用unix socket还是TCP,及其配置
原文: http://blog.csdn.net/pcyph/article/details/46513521 -------------------------------------------- ...
- Nginx与PHP交互过程 + Nginx与PHP通信的两种方式
一.Nginx与PHP交互过程的7步走(用户对动态PHP网页访问过程) step1:用户将http请求发送给nginx服务器(用户和nginx服务器进行三次握手进行TCP连接) step2:nginx ...
- nginx与php-fpm通信的两种方式
简述 在linux中,nginx服务器和php-fpm可以通过tcp socket和unix socket两种方式实现. unix socket是一种终端,可以使同一台操作系统上的两个或多个进程进行数 ...
- PHP-FPM 与 Nginx 的通信机制总结
PHP-FPM 介绍 CGI 协议与 FastCGI 协议 每种动态语言( PHP,Python 等)的代码文件需要通过对应的解析器才能被服务器识别,而 CGI 协议就是用来使解释器与服务器可以互 ...
- 【高级】PHP-FPM和Nginx的通信机制
PHP-FPM 介绍 CGI 协议与 FastCGI 协议 每种动态语言( PHP,Python 等)的代码文件需要通过对应的解析器才能被服务器识别,而 CGI 协议就是用来使解释器与服务器可以互相通 ...
随机推荐
- 欧拉函数:HDU1787-GCD Again(欧拉函数的模板)
GCD Again Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Sub ...
- 大数据学习——spark笔记
变量的定义 val a: Int = 1 var b = 2 方法和函数 区别:函数可以作为参数传递给方法 方法: def test(arg: Int): Int=>Int ={ 方法体 } v ...
- python - 自动化测试框架 - 测试报告
testSuitr.py: # -*- coding:utf-8 -*- '''@project: Voctest@author: Jimmy@file: testSuite.py@ide: PyCh ...
- 02-python进阶-文件操作
新建一个文件 内容是从 0-9的整数 #coding:utf-8 f = open('1.txt','w') #r 只读 w 可写 a追加 for i in range(0,10): f.write( ...
- 爬虫Scrapy框架-2爬取网站视频详情
爬取视频详情:http://www.id97.com/ 创建环境: movie.py 爬虫文件的设置: # -*- coding: utf-8 -*- import scrapy from movi ...
- [python学习篇] uiautomator xiaocong
Skip to content This repository Pull requests Issues Marketplace Gist Sign out Watch103 ...
- [uiautomator篇][10] uiautomator进阶
http://coderlin.coding.me/2016/07/02/Android-%E8%BF%9B%E9%98%B6%E4%B9%8B%E8%87%AA%E5%8A%A8%E5%8C%96% ...
- hdu5443 The Water Problem
The Water Problem Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Othe ...
- java8新特性lamda表达式在集合中的使用
1.利用stream().forEach()循环处理List; List<String> list = Lists.newArrayList();//新建一个List 用的google提供 ...
- Linux Shell系列教程之(八)Shell printf命令详解
本文是Linux Shell系列教程的第(八)篇,更多shell教程请看:Linux Shell系列教程 在上一篇:Linux Shell系列教程之(七)Shell输出这篇文章中,已经对Shell p ...