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.当 ...
随机推荐
- Google Code Jam 2014 总结
第一次参加ACM竞赛,对自己取得的成绩还满意. Round1A: Rank: 2446 Score: 9 (没有进前1000名,只能拼下次了) Round1B: Rank: 944 Score: 42 ...
- jQuery—$让渡
方法1:(取别名) 方法2:(指定作用域) 场景用例: 解决方案:方法1(取别名) 解决方案:方法2(指定作用域)
- git 常用命令行操作
git常用命令行操作: 点击 git bash 进入到命令行: git clone https://github.com/wlz1244/qingoo.git //下载一个master分支代码 g ...
- log4j相关配置
1.概述 log4j是Apache提供的一个日志实现,可以用于我们项目中的日志记录,有log4j1和log4j2两个版本,本文使用log4j2这个版本.SLF4J(Simple log ...
- Spring自动装配Bean的五种方式
在Spring中,支持 5 自动装配模式. no – 缺省情况下,自动配置是通过“ref”属性手动设定,在项目中最常用byName – 根据属性名称自动装配.如果一个bean的名称和其他bean属性的 ...
- Codeforces Round #112 (Div. 2) D. Beard Graph
地址:http://codeforces.com/problemset/problem/165/D 题目: D. Beard Graph time limit per test 4 seconds m ...
- redis 慢查询日志
说明:针对慢查询日志,可以设置两个参数,一个是执行时长,单位为微秒,另一个是慢查询日志的长度.如果超过该长度,当一个新的命令被写入日志时,最老的一条会从命令日志队列中被移除. 编辑配置文件redis. ...
- 使用BusyBox制作根文件系统
1.BusyBox简介 BusyBox 是很多标准 Linux 工具的一个单个可执行实现.BusyBox 包含了一些简单的工具,例如 cat 和 echo,还包含了一些更大.更复杂的工具,例如 gre ...
- JVM反调调用优化,导致发生大量异常时log4j2线程阻塞
背景 在使用log4j2打日志时,当发生大量异常时,造成大量线程block问题的问题. 一个关于log4j2的高并发问题:https://blog.fliaping.com/a-high-concur ...
- linux下tar的使用方法
1.仅打包 tar -cvf hello.tar hello (输出文件大小为10240) 2.打包后压缩成gzip压缩格式 tar -czvf hello.tar.gz hello (输出文件大小为 ...