nginx配置优化-生产环境应用版
user www www;
worker_processes auto;
worker_cpu_affinity auto;
error_log /usr/local/nginx/logs/error.log warn;
pid nginx.pid;
worker_rlimit_nofile 65535; events
{
use epoll;
multi_accept on;
worker_connections 65530;
} http
{
include mime.types;
default_type application/octet-stream;
charset utf-8;
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 40s;
client_header_timeout 10;
client_body_timeout 10;
client_header_buffer_size 4k;
server_names_hash_bucket_size 128;
large_client_header_buffers 4 32k;
client_max_body_size 100m;
send_timeout 10;
reset_timedout_connection on;
open_file_cache max=102400 inactive=20s;
open_file_cache_min_uses 1;
open_file_cache_valid 30s; fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 128k; #出现110错误需要更改相应大小值
fastcgi_buffers 256 128k;
fastcgi_busy_buffers_size 256k; #fastcgi_buffers的两倍
fastcgi_temp_file_write_size 256k; #fastcgi_buffers的两倍 proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 128k; #出现110错误需要更改相应大小值
proxy_buffers 256 128k;
proxy_busy_buffers_size 256k; #proxy_buffers的两倍
proxy_temp_file_write_size 256k; #proxy_buffers的两倍 gzip on;
gzip_min_length 256;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 5;
gzip_disable "MSIE [1-6]\.";
gzip_proxied any;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy; log_format access '{"@timestamp":"$time_iso8601",'
'"host":"$server_addr",'
'"clientip":"$remote_addr",'
'"size":$body_bytes_sent,'
'"responsetime":$request_time,'
'"upstreamtime":"$upstream_response_time",'
'"upstreamhost":"$upstream_addr",'
'"http_host":"$host",'
'"url":"$uri",'
'"xff":"$http_x_forwarded_for",'
'"referer":"$http_referer",'
'"agent":"$http_user_agent",'
'"status":"$status"}';
access_log /usr/local/nginx/logs/access.log access;
server {
listen 80;
server_name localhost;
index index.html index.php;
root /data/www/default;
access_log /usr/local/nginx/logs/access.log;
error_log /usr/local/nginx/logs/error.log; if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
} location ~ \.php {
expires -1;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
nginx配置优化-生产环境应用版的更多相关文章
- php配置优化-生产环境应用版
[global] error_log = log/php-fpm.log log_level = warning emergency_restart_threshold = 10 emergency_ ...
- Nginx配置优化详解
如果你已经安装过Nginx并在生产环境中使用,那么Nginx配置优化你一定也要做,这样才能看到Nginx性能,本文就从基本配置优化开始到高层配置教你如何优化Nginx 大多数的Nginx安装指南告诉你 ...
- CentOS8本地安装Redash中文版,并且配置为生产环境
Centos8内置的Python为3.6.8版本,以下是在内置Python3.6.8基础上的安装步骤.由于安装多版本Python会导致系统底层库需要下载源码重新编译,比较麻烦,不建议在多版本Pytho ...
- Tomcat与Jre绿色环境配置(生产环境)
Tomcat与Jre绿色环境配置(生产环境) 博客分类: Apache Java jreapachetomcat Tomcat运行时需要jre的支持,一般有两种方式,一种是用jdk带的jre,另一种 ...
- nginx 配置优化的几个参数
nginx 配置优化的几个参数 2011-04-22 本文地址: http://blog.phpbean.com/a.cn/7/ --水平有限欢迎指正-- -- 最近在服务器上搞了一些nginx 研究 ...
- PHP+FastCGI+Nginx配置PHP运行环境方法
PHP+FastCGI+Nginx配置PHP运行环境 Nginx不支持对外部程序的调用,所以必须通过FastCGI接口实现对外部程序的调用从而实现对客户端动态页面请求的处理. CGI的英文全称为Com ...
- Nginx配置优化参考
Nginx配置优化参考 ...
- nginx配置优化提高并发量
1 nginx配置优化提高并发量 worker_processes 2; 这个按照CPU的核数来决定 2 worker_connections 65535; 这个一般设置65535即可 每个进程允许的 ...
- nginx 和 tomcat 生产环境配置 建议和方法
参考 以下内容: http://blog.csdn.net/lifetragedy/article/details/7708724 一. nginx参数调优 worker_processes 3; ...
随机推荐
- POJ1053 Set Me
题目来源:http://poj.org/problem?id=1053 题目大意: 有一种牌,共有81张.每张牌有四个属性,每种属性有三种可能取值:形状(D,O,S),数字(1,2,3),颜色(R,G ...
- Oracle 11g服务OracleDBConsoleorcl启动失败(异常或报错)
OracleDBConsoleorcl:Oracle数据库控制台服务,orcl是Oracle的实例标识,默认的实例为orcl.在运行Enterprise Manager(企业管理器OEM)的时候,需要 ...
- nginx与 Keepalived高可用
1.1 keepalived软件能干什么? Keepalived软件起初是专为LVS负载均衡软件设计的, 用来管理并监控LVS集群系统中各个服务节点的状态,后来又加入了可以实现高可用的VRRP功能 K ...
- datetimepicker使用
常考地址:http://www.bootcss.c 直接上代码: 步骤:1.http://www.bootcss.com/p/bootstrap-datetimepicker/下载包 2.将里面的js ...
- Autel MaxiSys MS908CV Diagnostic System for Commercial Vehicles
As a new member of Autel’s MaxiSys family, the MaxiSys CV is built on the powerful MaxiSys 908 platf ...
- 19. Remove Nth Node From End of List(C++,Python)
Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...
- Vue.js-----轻量高效的MVVM框架(八、使用组件)
什么是组件? 组件(Component)是 Vue.js 最强大的功能之一.组件可以扩展 HTML 元素,封装可重用的代码.在较高层面上,组件是自定义元素,Vue.js 的编译器为它添加特殊功能.在有 ...
- 转载 Some indexes or index [sub]partitions of table VAS.TAB_PUB_CALLLOG have been marked unusable
http://www.xifenfei.com/2011/12/some-indexes-or-index-subpartitions-of-table-vas-tab_pub_calllog-hav ...
- 对四次挥手中的TIME_WAIT状态的学习
TIME_WAIT状态不必多说 是属于四次挥手中的一种特殊状态 作用有两点简单明了 不废话 (1)可靠的实现TCP全双工连接的终止 (2)允许老的重复的.迟到的分节在网络中消逝 ...
- ERROR:105: Unable to locate a modulefile for 'xxx'
查看可用的 module:module avail 将xxx替换为屏幕输出中已有的模块.