B服务器,例:

[root@localhost conf.d]# egrep -v "^#|^$" /etc/nginx/nginx.conf

user nginx;
worker_processes 8;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
worker_rlimit_nofile 65520;
include /usr/share/nginx/modules/*.conf;
events {
use epoll;
worker_connections 10240;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
#gzip 压缩传输
gzip on;
gzip_min_length 1k; #最小1K
gzip_buffers 16 64K;
#gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain application/x-javascript text/css application/xml application/javascript image/jpeg image/gif image/png;
gzip_vary on;
include /etc/nginx/mime.types;
default_type application/octet-stream;
proxy_intercept_errors on;
proxy_redirect off;
#proxy_set_header Host $host;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 328k;
proxy_connect_timeout 90;
proxy_read_timeout 90;
proxy_send_timeout 90;
proxy_buffer_size 40k;
proxy_buffers 4 320k;
proxy_busy_buffers_size 640k;
proxy_temp_file_write_size 640k;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
}

[root@localhost conf.d]# ls
chandao.conf cmsapitest.conf shtest.conf

[root@localhost conf.d]# more chandao.conf

server {
listen 8079;
server_name chandao.abc.com; location / {
proxy_pass http://192.xxx.xxx.43:9090/;
} location = /favicon.ico {
log_not_found off;
access_log off;
} error_page 404 http://chandao.abc.com:8079;
error_page 500 502 503 504 http://chandao.abc.com:8079;
} # 不允许IP地址直接访问
server {
listen 8079 default;
server_name _;
return 403;
}

[root@localhost conf.d]# more cmsapitest.conf

server {
listen 8079;
server_name cmsapitest.abc.com; location / {
proxy_pass http://192.xxx.xxx.43:8078/;
} location = /favicon.ico {
log_not_found off;
access_log off;
} error_page 404 http://cmsapitest.abc.com:8079;
error_page 500 502 503 504 http://cmsapitest.abc.com:8079; }

[root@localhost conf.d]# more gw.conf

server {
listen 8089;
server_name _;
root /var/www/lwgw; location / {
root /var/www/lwgw/gw;
try_files $uri /index.html;
expires 1m;
} location ^~ /actives {
try_files $uri $uri/ /actives/index.html;
expires 1m;
} location ^~ /activeBargain {
try_files $uri $uri/ /activeBargain/index.html;
expires 1m;
} # location ^~ /gw-mobile {
# try_files $uri $uri/ /gw-mobile/index.html;
# expires 1m;
# } location ^~ /active/pc {
try_files $uri $uri/ /active/pc/index.html;
expires 1m;
} location ^~ /active/mobile {
try_files $uri $uri/ /active/mobile/index.html;
expires 1m;
} location /api {
proxy_pass http://218.xxx.xxx.42:8088/;
} location /activeApi {
proxy_pass http://218.xxx.xxx.42:8088/;
} location /getTitleApi {
proxy_pass http://218.xxx.xxx.44:9993/;
} location /wxApi {
proxy_set_header Host api.weixin.qq.com;
rewrite /wxApi/(.+)$ /$1 break;
proxy_pass https://api.weixin.qq.com;
} location /wx {
proxy_set_header Host api.weixin.qq.com;
rewrite /wx/(.+)$ /$1 break;
proxy_pass https://api.weixin.qq.com;
} location /up {
rewrite "^/up\/(.*)$" http://218.xxx.xxx.42:8088/up/$1;
expires 1d;
} location /bargainBaseUrl {
proxy_pass http://218.xxx.xxx.42:8078/;
} location = /favicon.ico {
log_not_found off;
access_log off;
} error_page 404 http://218.xxx.xxx.42:8089;
error_page 500 502 503 504 http://218.xxx.xxx.42:8089; }

  

Nginx配置记录【例2】的更多相关文章

  1. nginx配置样例

    简单的nginx配置如下,包含了静态文件配置.websocket.socket.io的配置: user nobody; worker_processes 3; #master_process off; ...

  2. Nginx配置记录【例1】

    A服务器,例: [root@localhost conf.d]# egrep -v "^#|^$" /etc/nginx/nginx.conf user nginx; worker ...

  3. Nginx配置记录【例3】

    C服务器,例: [root@82_www_db_2 conf.d]# egrep -v "^#|^$" /etc/nginx/nginx.conf user nginx; work ...

  4. nginx配置记录

    user www-data;worker_processes 1; error_log /var/log/nginx/error.log;pid /var/run/nginx.pid; events ...

  5. nginx 配置记录 上传文件大小 size client

    cat nginx.conf worker_processes auto;events { worker_connections 1024;}http { include mime.types; de ...

  6. 在docker容器中如何自动生成配置文件(以nginx配置为例)

    应用场景类似于多个域名要起多个容器,有些参数有些域名需要,有些域名不需要,或者参数的值不太一样,需要去对应的配置文件修改,不太灵活,如果通过变量的方式直接定义在Dockerfile文件中,需要哪些参数 ...

  7. 一些NGINX配置

    一些nginx配置 使用独立目录, 然后include具体配置 gzip on for multi processers static file cache proxy pass 静态目录 or 文件 ...

  8. nginx配置反向代理或跳转出现400问题处理记录

    午休完上班后,同事说测试站点访问接口出现400 Bad Request  Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...

  9. nginx https 配置样例

    站点nginx https 配置模板 第一章 nginx 支持https 配置样例 其他 相关链接地址 第一章 nginx 支持https 配置样例 说明:https 段配置参数说明 Server 段 ...

随机推荐

  1. python_0基础开始_day07

    第七节 1,基础数据类型补充 str: print(str.capitalize()) —— 首字母大写 print(str.title()) —— 每个单词的首字母大写 print(str.swap ...

  2. API接口之安全篇

    APP.前后端分离项目都采用API接口形式与服务器进行数据通信,传输的数据被偷窥.被抓包.被伪造时有发生,那么如何设计一套比较安全的API接口方案呢? 一般的解决方案如下: 1.Token授权认证,防 ...

  3. 一个页面两个div(一个柱状图或者折线图一个饼图)

    需求是一个页面中两个图,一个饼图一个折线图,接口用的是一个接口,柱状图的图例要隐藏掉,X轴为月份,每月份都有两个数据,也就是图例是两个(进口和出口)的意思饼图需要显示最新月份数据,并且有一个下拉框可以 ...

  4. Linux 配置:Xmanager连接Linux图形界面

    想要在远程终端使用用图形界面来操作和控制Linux服务器,就在windows下像使用MSTSC一样.linux通过XDMCP来提供这种支持,我们只要用一个终端仿真软件如:xmanager就可以实现,但 ...

  5. Hive分区表创建、分类

    一.分区表创建与说明 必须在表定义时创建partition a.单分区建表语句:create table day_table (id int, content string) partitioned ...

  6. tornado实现高并发爬虫

    from pyquery import PyQuery as pq from tornado import ioloop, gen, httpclient, queues from urllib.pa ...

  7. 架构师成长之路5.5-Saltstack配置管理(状态间关系)

    点击架构师成长之路 架构师成长之路5.5-Saltstack配置管理(状态间关系) 配置管理工具: Pupper:1. 采用ruby编程语言:2. 安装环境相对较复杂:3.不支持远程执行,需要FUNC ...

  8. java 学习笔记(四) java连接ZooKeeper

    public class Demo2 { public static void main(String[] args) { String connectString = "192.168.1 ...

  9. 【HDU6635】Nonsense Time

    题目大意:给定一个长度为 N 的序列,开始时所有的位置都不可用,每经过一个时间单位,都会有一个位置被激活.现给定激活顺序的序列,求每次激活之后全局的最长上升子序列的长度,保证数据随机. 题解: 引理: ...

  10. 对于Arraylist 的一些疑问

    是否保证线程安全? ArrayList 和 LinkedList 都是不同步的,也就是不保证线程安全. 底层数据结构区别? Arraylist 底层使用的是Object数组:LinkedList 底层 ...