nginx默认配置
user nobody;
worker_processes 2;
worker_cpu_affinity 000000001000 000000010000;
worker_rlimit_nofile 51200;
pid sbin/nginx.pid;
error_log logs/error.log error; events {
use epoll;
worker_connections 1024;
} http {
include mime.types;
default_type application/octet-stream;
server_tokens off;
keepalive_timeout 75s; sendfile off;
tcp_nopush on;
tcp_nodelay on; client_max_body_size 32m; # Proxy
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off;
proxy_pass_header Set-Cookie;
proxy_hide_header X-Powered-By;
proxy_hide_header X-Mod-Pagespeed;
proxy_ignore_client_abort off;
proxy_cache_valid any 10m; proxy_connect_timeout 75s;
proxy_read_timeout 75s;
proxy_send_timeout 75s; # Log
log_format main '-[$time_local] <$remote_addr> <$request -$status> <$upstream_addr -$upstream_status>';
access_log logs/access.log main buffer=16k;
open_log_file_cache max=10 inactive=30s min_uses=2 valid=60s; # LoadBlance
upstream appservers {
server 192.168.240.1:8081 weight=5 max_fails=2 fail_timeout=30s;
server 192.168.240.1:8082 weight=4 max_fails=2 fail_timeout=30s;
#server 192.168.240.1:8083 weight=3 max_fails=2 fail_timeout=30s;
#server 192.168.240.1:8084 weight=2 max_fails=2 fail_timeout=30s;
server 192.168.240.1:8085 backup;
#server 192.168.240.2:8081 weight=5 max_fails=2 fail_timeout=30s;
#server 192.168.240.2:8082 weight=4 max_fails=2 fail_timeout=30s;
#server 192.168.240.2:8083 weight=3 max_fails=2 fail_timeout=30s;
#server 192.168.240.2:8084 weight=2 max_fails=2 fail_timeout=30s;
#server 192.168.240.2:8085 backup;
#server 192.168.240.1:8081;
#server 192.168.240.1:8082;
#server 192.168.240.1:8083;
#server 192.168.240.1:8084;
#server 192.168.240.1:8085;
#server 192.168.240.2:8081;
#server 192.168.240.2:8082;
#server 192.168.240.2:8083;
#server 192.168.240.2:8084;
#server 192.168.240.2:8085;
} upstream moonregionservers {
server 192.168.240.10:8081;
server 192.168.240.10:8082;
server 192.168.240.10:8083;
server 192.168.240.10:8084;
server 192.168.240.10:8085;
} upstream moonMallproxyserver {
server 127.0.0.1:8081;
#server 127.0.0.1:8082;
server 192.168.236.3:8081;
#server 192.168.236.3:8082;
#server 192.168.236.3:8083;
#server 192.168.236.3:8084;
#server 192.168.236.3:8085;
} upstream bluemmSiteserver {
server 192.168.240.2:8085;
#server 127.0.0.1:8082;
} upstream bluemoonProxy{
server 127.0.0.1:8083;
} server {
server_name mall.bluemoon.com.cn;
listen 80;
#charset utf-8; location /nginx_status {
stub_status on;
access_log off;
} location / {
proxy_pass http://appservers;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
} # FTP.
#location ^~/ftp {
# proxy_pass http://10.251.68.12/;
#} location /wxPay/ {
proxy_pass https://api.mch.weixin.qq.com:443/pay/unifiedorder;
proxy_redirect default ;
} location /moonRegion {
index index.html index.htm;
proxy_pass http://moonregionservers;
} location /App {
alias /data/static/App;
index index.html index.htm;
} location /webApp {
alias /data/static/webApp;
index index.html index.htm;
} location /mall {
alias /data/static/mall;
index index.html index.htm;
} location /upload {
proxy_pass http://192.168.240.3:80/upload/;
} location /angelUpload{
proxy_pass http://192.168.240.22:80/upload/;
} #wx pay
#wx pay
location /moonMall-proxy {
#proxy_pass http://192.168.236.2:8081/moonMall-proxy;
proxy_pass http://moonMallproxyserver;
} #bluemmSite
location /bluemmSite {
#proxy_pass http://192.168.236.2:8081/moonMall-proxy;
proxy_pass http://bluemmSiteserver;
} #kouzhiqiang webservice proxy
location /bluemoon-proxy {
proxy_pass http://bluemoonProxy;
} # Global.
location = / {
root html;
index index.html index.htm;
} location = /update.html {
root html;
} error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
} error_page 403 404 410 /404.html;
location = /404.html {
root html;
}
} #ssl #upstream wxpay {
# server https://api.mch.weixin.qq.com; #}
server {
listen 443 ssl;
server_name s.bluemoon.com.cn; ssl_certificate /data/key/moonmall.bluemoon.com.cn_bundle.crt;
ssl_certificate_key /data/key/moonmall.bluemoon.com.cn.key; ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m; ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on; keepalive_timeout 70; location / {
#proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://api.mch.weixin.qq.com/pay/unifiedorder;
#proxy_pass http://192.168.240.10:8080/moonRegion/; } #location /wxPay {
# proxy_pass https://api.mch.weixin.qq.com:443/pay/unifiedorder;
# }
}
}
nginx默认配置的更多相关文章
- nginx 默认配置语法和日志的format
nginx 默认配置 查看有nginx哪些默认配置文件,打开/etc/nginx/nginx.conf文件,查看尾行部分 会默认将/etc/nginx/conf.d/文件下其他以.conf结尾的配置文 ...
- Nginx默认配置语法
Nginx默认配置语法 1. 我们进入 /etc/nginx/目录下,打开 nginx.conf文件 2. 我们来解析下 这里面标签和各模块的作用 # 设置nginx服务的系统使用用户 user ...
- nginx默认配置和默认站点启动
1.nginx的配置文件nginx.conf cd /etc/nginx/ vim nginx.conf 打开后的文件为: user nginx;worker_processes 1; error_l ...
- Nginx 默认配置解析
# For more information on configuration, see: # * Official English Documentation: http://nginx.org/e ...
- nginx、php-fpm默认配置与性能–TCP socket还是unix domain socket【转】
原文地址:https://www.cnxct.com/default-configuration-and-performance-of-nginx-phpfpm-and-tcp-socket-or-u ...
- nginx介绍(二) - 默认配置
前言 前面, 在浏览器中, 输入linux 的ip, 出现了以下页面: 那这个页面在哪里呢? 一. 工具 notepad++ 在进入主题之前, 先来介绍下, 一会使用到的工具. 在notepad++里 ...
- nginx下配置多个web服务
参考 nginx配置详解 nginx反向代理与负载均衡详解 一.nginx简介: Nginx("engine x")是一款是由俄罗斯的程序设计师Igor Sysoev所开发高性能 ...
- 如何在Nginx下配置PHP程序环境
1.nginx与PHP的关系 首先来看nginx与php的关系, FastCGI的关系(而不是像apache那样安装成nginx的模块) FastCGI的意思是, 快速的通用网关接口:CGI Comm ...
- Nginx主配置参数详解,Nginx配置网站
1.Niginx主配置文件参数详解 a.上面博客说了在Linux中安装nginx.博文地址为:http://www.cnblogs.com/hanyinglong/p/5102141.html b.当 ...
随机推荐
- SVN无法Cleanup
错误如下: 原因:svn提交遇到恶心的问题,可能是因为上次cleanup中断后,进入死循环了 解决方法:清空svn的队列 1.下载Sqlite3.exe 2.找到你项目的.svn文件,查看是否存在wc ...
- Django:学习笔记(8)——视图
Django:学习笔记(8)——视图
- PKU 1129 Channel Allocation(染色问题||搜索+剪枝)
题目大意建模: 一个有N个节点的无向图,要求对每个节点进行染色,使得相邻两个节点颜色都不同,问最少需要多少种颜色? 那么题目就变成了一个经典的图的染色问题 例如:N=7 A:BCDEFG B:ACDE ...
- es6的Set和Map数据结构
Set 和 Map 数据结构 Set WeakSet Map WeakMap Set § ⇧ 基本用法 ES6 提供了新的数据结构 Set.它类似于数组,但是成员的值都是唯一的,没有重复的值. Set ...
- Django restful Framework 之序列化与反序列化
1. 首先在已建好的工程目录下新建app命名为snippets,并将snippets app以及rest_framework app加到工程目录的 INSTALLED_APPS 中去,具体如下: IN ...
- 2016-2017 National Taiwan University World Final Team Selection Contest C - Crazy Dreamoon
题目:Statements Dreamoon likes algorithm competitions very much. But when he feels crazy because he ca ...
- NGUI制作 《九宫格》 图片
什么是九宫格图片? 就是一张图片的上下左右四个角是固定的,无论X/Y被拉伸多大,图片都不会失真 效果图 ------> 那在NGUI里面怎么做到呢 1 首先你要把图片添加到NGUI图集里,点击E ...
- ABP官方文档翻译 1.1 介绍
介绍 介绍 快速示例 其他 启动模板 如何使用 介绍 我们通常会根据不同的需求来创建不同的应用程序.但是对于一些通用相似的结构总是一遍又一遍的实现,至少在某种程度上是这样的.常见的通用模块如授权.验证 ...
- Java Calendar类总结
在实际项目当中,我们经常会涉及到对时间的处理,例如登陆网站,我们会看到网站首页显示XXX,欢迎您!今天是XXXX年....某些网站会记录下用户登陆的时间,比如银行的一些网站,对于这些经常需要处理的问题 ...
- Web服务器对比介绍
1.Apache Apache是非常强大的老牌Web服务器,具有模块化结构,拥有众多非常成熟稳定的模块,目前仍是使用非常广泛的服务器,但它是基于多进程HTTPServer,需要对每个用户请求创建一个子 ...