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.当 ...
随机推荐
- 虚拟机Linux系统忘记密码的情况下,修改root或其他用户密码
使用场景 linux管理员忘记root密码,需要进行找回操作. 注意事项:本文基于centos7环境进行操作,由于centos的版本是有差异的,继续之前请确定好版本. 步骤 一.重启系统,在开机过程中 ...
- Java ArrayList详细介绍和使用示例
①对ArrayList的整体认识 ArrayList是一个数组队列,相当于动态数组.与Java中的数组相比,它的容量能动态增长.它继承了AbstractList,实现了List,RandomAcces ...
- c++类static成员
转自:http://blog.csdn.net/heyabo/article/details/8681516 参考文献:1.http://www.yesky.com/20010828/194000.s ...
- [原创]css中a标签去掉锚点文本下划线
我对博客的认识是:记录问题,解决问题,分享知识.如果有轮子,我不需要造轮子. 1.问题解决方式: 设置属性:text-decoration:none; 2.更多属性参数参考 text-decorati ...
- ThinkPHP项目 公共方法存放位置
ThinkPHP项目公共方法写在 根目录-> app-> common 里面 ThinkPHP模板公共方法卸载 根目录->app->模块名称->common 里 ...
- [Face++]Face初探——人脸检测
经过了强烈的思想斗争才把自己拖到图书馆做毕设T^T anyway, 因为毕设里面有人脸识别的部分,所以就想找个现成的api先玩玩,于是就找到最近很火的face++:http://www.faceplu ...
- centos6.9 升级glibc(升级到 2.17版)
原系统centos6.9自带GLIBC_2.12,安装一些软体提示版本不对,决定升级. wget http://ftp.gnu.org/gnu/glibc/glibc-2.17.tar.gz tar ...
- 【VS2015】未能创建 Visual C# 2015编译器
今天在安装完成Visual Studio 2015后,在执行update 3时出错,导致再次打开VS2015时提示错误:“未能创建 Visual C# 2015编译器”和“未能正确加载CSharpPa ...
- JS变量比较陷阱
我们觉得JS简单是因为它是弱类型的语言,不像java那样对对类型那样敏感,但js也有其不尽人意的地方. 在java中我们无法将数字与字符串直接比较,而js能,而且能直接转换成数值比较,但是如果是字符串 ...
- Python3.x:获取代理ip以及使用
Python3.x:获取代理ip以及使用 python爬虫浏览器伪装 #导入urllib.request模块 import urllib.request #设置请求头 headers=("U ...