#user nobody;
worker_processes 24;
worker_rlimit_nofile 262144;
worker_cpu_affinity 000000000000000000000001 000000000000000000000010 000000000000000000000100 000000000000000000001000 000000000000000000010000 000000000000000000100000 000000000000000001000000 000000000000000010000000 000000000000000100000000 000000000000001000000000 000000000000010000000000 000000000000100000000000 000000000001000000000000 000000000010000000000000 000000000100000000000000 000000001000000000000000 000000010000000000000000 000000100000000000000000 000001000000000000000000 000010000000000000000000 000100000000000000000000 001000000000000000000000 010000000000000000000000 100000000000000000000000;

pid /var/run/nginx.pid;
events {
use epoll;
multi_accept on;
worker_connections 10000;
}

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

http {
include mime.types;
default_type application/octet-stream;

log_format main '$time_local|$upstream_response_time|$request_time|$status|$http_referer|$request|$http_user_agent|$upstream_addr|$http_x_forwarded_for|$request_body';
#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

upstream pap_backend_conf {
keepalive 128;
server 127.0.0.1:9221 max_fails=2 fail_timeout=5 weight=100;
server 10.110.94.152:9221 max_fails=2 fail_timeout=5 weight=100;
server 10.110.94.152:9220 max_fails=2 fail_timeout=5 weight=100;
}
server {
listen 9220;
server_name _;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
access_log /letv/logs/nginx/access.log main;
error_log /letv/logs/nginx/error.log;
proxy_pass http://pap_backend_conf;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}

#user nobody;
worker_processes 24;
worker_rlimit_nofile 262144;
worker_cpu_affinity 000000000000000000000001 000000000000000000000010 000000000000000000000100 000000000000000000001000 000000000000000000010000 000000000000000000100000 000000000000000001000000 000000000000000010000000 000000000000000100000000 000000000000001000000000 000000000000010000000000 000000000000100000000000 000000000001000000000000 000000000010000000000000 000000000100000000000000 000000001000000000000000 000000010000000000000000 000000100000000000000000 000001000000000000000000 000010000000000000000000 000100000000000000000000 001000000000000000000000 010000000000000000000000 100000000000000000000000;

pid /var/run/nginx.pid;
events {
use epoll;
multi_accept on;
worker_connections 10000;
}

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

http {
include mime.types;
default_type application/octet-stream;

log_format main '$time_local|$upstream_response_time|$request_time|$status|$http_referer|$request|$http_user_agent|$upstream_addr|$http_x_forwarded_for|$request_body';
#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

#gzip on;

upstream pap_backend_conf {
keepalive 128;
server 127.0.0.1:9221 max_fails=2 fail_timeout=5 weight=100;
server 10.110.94.152:9221 max_fails=2 fail_timeout=5 weight=100;
server 10.110.94.152:9220 max_fails=2 fail_timeout=5 weight=100;
}
server {
listen 9220;
server_name _;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
access_log /letv/logs/nginx/access.log main;
error_log /letv/logs/nginx/error.log;
proxy_pass http://pap_backend_conf;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;

# location / {
# root html;
# index index.html index.htm;
# }
#}

# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;

# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;

# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}

}

一份完整的nginx配置的更多相关文章

  1. Nginx配置网站适配PC和手机

    考虑到网站的在多种设备下的兼容性,有很多网站会有手机版和电脑版两个版本.访问同一个网站URL,当服务端识别出用户使用电脑访问,就打开电脑版的页面,用户如果使用手机访问,则会得到手机版的页面. 1.判断 ...

  2. Nginx配置站点适配PC和手机

    考虑到站点的在多种设备下的兼容性,有非常多站点会有手机版和电脑版两个版本号.訪问同一个站点URL,当服务端识别出用户使用电脑訪问.就打开电脑版的页面,用户假设使用手机訪问,则会得到手机版的页面. 1. ...

  3. 【转】Nginx 学习笔记(十一)nginx下安装配置naxsi waf防火墙(附完整编译、配置)

    原文地址:http://f2ex.cn/nginx-installed-configuration-naxsi-waf/ Naxsi 是第三方 nginx 模块 ,它和 Modsecurity 都是开 ...

  4. Nginx配置Https(详细、完整)

    Nginx配置Https(详细.完整) 原文链接:请支持原创 前置条件: 在配置https之前请确保下面的步骤已经完成 服务器已经安装nginx并且通过http可以正常访问 不会安装nginx的可以参 ...

  5. nginx配置(windows配置)

    以下是我的项目用到的一份配置文件#user  nobody;worker_processes  4; #进程数,一般cpu是几核就写多少#error_log  logs/error.log;#erro ...

  6. Nginx配置杂记(转)

    转至:http://www.cnblogs.com/kuangke/p/5619400.html Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器,相较 ...

  7. NGINX 配置 SSL 双向认证

    对于 NGINX 的 HTTPS 配置,通常情况下我们只需要实现服务端认证就行,因为浏览器内置了一些受信任的证书颁发机构(CA),服务器端只需要拿到这些机构颁发的证书并配置好,浏览器会自己校验证书的可 ...

  8. rewrite规则写法及nginx配置location总结

    rewrite只能放在server{},location{},if{}中,并且只能对域名后边的除去传递的参数外的字符串起作用. 例如http://seanlook.com/a/we/index.php ...

  9. nginx配置入门

    谢谢作者的分享精神,原文地址:http://www.nginx.cn/591.html nginx配置入门 之前的nginx配置是对nginx配置文件的具体含义进行讲解,不过对于nginx的新手可能一 ...

随机推荐

  1. redis 优化

    系统优化echo "vm.overcommit_memory=1" > /etc/sysctl.conf 0, 表示内核将检查是否有足够的可用内存供应用进程使用:如果有足够的 ...

  2. IPC之PIPE

    管道是一种只允许用在有亲属关系的进程间通信的方式,由函数pipe创建一个管道,read,write进行读写操作. #include <unistd.h> ]); 参数pipefd[2]数组 ...

  3. python Quicksort demo

    __author__ = 'student' ''' quicksort step 1, choose one pivot, such as pivot=la[0] step 2, scan the ...

  4. 1.NopCommerce下载与安装

    NoCommerce是基于微软ASP.NET MVC + EntityFramework 技术开发的一套开源电子商城系统,其架构与设计非常精妙被誉为.NET商城的经典之作. 作为一个.NET程序爱好者 ...

  5. Ubuntu 14.04 LTS Server 无法挂载光盘 启动initramfs等问题

    今天需要在戴尔R410服务器上装64位的Linux,师兄给了个14.04的server 64位镜像.一开始打算用U盘安装,用软碟通烧写镜像之后,在服务器端设置从U盘启动,但是安装到一半出现了光盘无法挂 ...

  6. 【读书笔记《Android游戏编程之从零开始》】17.游戏开发基础(游戏适屏的简述和作用、让游戏主角动起来)

    1.游戏适屏的简述和作用 由于市面上安装 Android 系统的手机不断增多,出现了各种分辨率.各种屏幕尺寸的Android 系统手机.为了保证一个游戏或者一个软件能在所有的 Android 手机上正 ...

  7. ios开发之CoreData使用

    1.在工程中添加build Phases的Link Binary with Libraries下添加CoreData的库. 2.在当前工程中新建文件选择CoreData——>DataModel, ...

  8. bzoj-3288 3288: Mato矩阵(数论)

    题目链接: 3288: Mato矩阵 Time Limit: 10 Sec  Memory Limit: 128 MB Description Mato同学最近正在研究一种矩阵,这种矩阵有n行n列第i ...

  9. 第20章 DLL高级技术(1)

    20.1 DLL模块的显式载入和符号链接 20.1.1 显式载入DLL模块 (1)构建DLL时,如果至少导出一个函数/变量,那么链接器会同时生成一个.lib文件,但这个文件只是在隐式链接DLL时使用( ...

  10. JMeter学习(三十一)Access Log Sampler

    前提: 在tomcat\conf\server.xml默认情况下,会有一段代码: <Valve className="org.apache.catalina.valves.Access ...