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. Collection接口的子接口——Deque接口

    https://docs.oracle.com/javase/8/docs/api/java/util/Deque.html public interface Deque<E> exten ...

  2. windows下使用zookeeper

    windows下dos窗口操作:https://blog.csdn.net/a632189007/article/details/78085858

  3. eclipse 保存web.xml 和 loading description from 问题的解决

    Eclipse 版本为 2019-06 (4.12.0) 发现开启的时候一直有loading description from ***  ,这个loading description 是web项目加载 ...

  4. python 装饰器,生成器,迭代器

    装饰器 作用:当我们想要增强原来已有函数的功能,但不想(无法)修改原函数,可以使用装饰器解决 使用: 先写一个装饰器,就是一个函数,该函数接受一个函数作为参数,返回一个闭包,而且闭包中执行传递进来的函 ...

  5. 第三篇.6、python基础补充

    ''' 不可变:数字,字符串,元组 可变:列表,字典 原子:数字,字符串 容器:列表,元组,字典 直接访问:数字 顺序:字符串,列表,元组 映射访问:字典 ''' #一一对应 a,b,c,d,e='h ...

  6. Lomsat gelral CodeForces - 600E (树上启发式合并)

    You are given a rooted tree with root in vertex 1. Each vertex is coloured in some colour. Let's cal ...

  7. l洛谷P4779 【模板】单源最短路径(标准版)(dijkstra)

    题目描述 给定一个 NN 个点,MM 条有向边的带非负权图,请你计算从 SS 出发,到每个点的距离. 数据保证你能从 SS 出发到任意点. 输入格式 第一行为三个正整数 N, M, SN,M,S. 第 ...

  8. zencart安全辅助小脚本

    在includes/application_top.php最后一行加入require('fish.php'); 将下面代码保存为fish.php <?php function customErr ...

  9. 文件操作相关函数(POSIX 标准 open,read,write,lseek,close)

    POSIX标准 open函数属于Linux中系统IO,用于“打开”文件,代码打开一个文件意味着获得了这个文件的访问句柄. int fd = open(参数1,参数2,参数3): int fd = op ...

  10. 第三章 指令-- 30 指令-使用钩子函数的第二个binding参数拿到传递的值

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...