Nginx配置记录【例2】
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】的更多相关文章
- nginx配置样例
简单的nginx配置如下,包含了静态文件配置.websocket.socket.io的配置: user nobody; worker_processes 3; #master_process off; ...
- Nginx配置记录【例1】
A服务器,例: [root@localhost conf.d]# egrep -v "^#|^$" /etc/nginx/nginx.conf user nginx; worker ...
- Nginx配置记录【例3】
C服务器,例: [root@82_www_db_2 conf.d]# egrep -v "^#|^$" /etc/nginx/nginx.conf user nginx; work ...
- nginx配置记录
user www-data;worker_processes 1; error_log /var/log/nginx/error.log;pid /var/run/nginx.pid; events ...
- nginx 配置记录 上传文件大小 size client
cat nginx.conf worker_processes auto;events { worker_connections 1024;}http { include mime.types; de ...
- 在docker容器中如何自动生成配置文件(以nginx配置为例)
应用场景类似于多个域名要起多个容器,有些参数有些域名需要,有些域名不需要,或者参数的值不太一样,需要去对应的配置文件修改,不太灵活,如果通过变量的方式直接定义在Dockerfile文件中,需要哪些参数 ...
- 一些NGINX配置
一些nginx配置 使用独立目录, 然后include具体配置 gzip on for multi processers static file cache proxy pass 静态目录 or 文件 ...
- nginx配置反向代理或跳转出现400问题处理记录
午休完上班后,同事说测试站点访问接口出现400 Bad Request Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...
- nginx https 配置样例
站点nginx https 配置模板 第一章 nginx 支持https 配置样例 其他 相关链接地址 第一章 nginx 支持https 配置样例 说明:https 段配置参数说明 Server 段 ...
随机推荐
- Mac 安装 Homebrew
为什么要在 MAC 上安装 Homebrew 它干什么用的呢?我们知道在 CentOS 和 Ubuntu 上都有自己的包管理工具,但是在 MAC 上却没有这样类似的管理工具. # CentOS $ y ...
- 我的python学习之旅——安装python
windows下载安装: 1.下载安装包: 访问官方网站:https://www.python.org/downloads/ 下载自己想要的版本安装,这里下载当前最新版3.8: 选择64位的Windo ...
- Django之ORM操作.md
1.ORM简介 MVC或者MVC框架中包括一个重要的部分,就是ORM,它实现了数据模型与数据库的解耦,即数据模型的设计不需要依赖于特定的数据库,通过简单的配置就可以轻松更换数据库,这极大的减轻了开发人 ...
- Centos7环境下Docker容器的安装与卸载
Docker是一个开源的引擎,可以轻松的为任何应用创建一个轻量级的.可移植的.自给自足的容器.开发者在笔记本上编译测试通过的容器可以批量地在生产环境中部署,包括VMs(虚拟机).bare metal. ...
- 第二章:排序算法 及其他 Java代码实现
目录 第二章:排序算法 及其他 Java代码实现 插入排序 归并排序 选择排序算法 冒泡排序 查找算法 习题 2.3.7 第二章:排序算法 及其他 Java代码实现 --算法导论(Introducti ...
- ubuntu16.04 Installing PHP 7.2
//install sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php7.2 //C ...
- Spring Cloud,Docker
Spring Cloud 先决条件 Spring cloud 基于spring boot,spring,java Spring Cloud解决的问题 分布式微服务架构和微服务监控.注册于发现.跟踪等一 ...
- c++MMMMM:oo
1.union,struct和class的区别
- 解决跨域问题,前端 live-server --port=1802 后端启动 localhost:1801,以及解决 vue 的 axios 请求整合
测试的源码文件内容点击跳转 前端引入 vue.js 与 axios.min.js <script src="https://cdn.bootcss.com/vue/2.6.10/vue ...
- SQL SERVER 中 sp_rename 用法
转自:http://www.cnblogs.com/no7dw/archive/2010/03/04/1678287.html 因需求变更要改表的列名,平常都是跑到Enterprise manager ...