nginx配置反向代理商

  • 时间:2018-06-18 22:59 作者:believing 来源:believing 阅读:181
  • 扫一扫,手机访问
摘要:这章讲的是nginx配置文件的知识,配置反向代理商。1、nginx配置反向代理商,代理商到tomcat页面#cat /usr/local/work/nginx/nginx.confworker_processes 8;worker_cpu_affinity 00000001 00000010 000

这章讲的是nginx配置文件的知识,配置反向代理商。

1、nginx配置反向代理商,代理商到tomcat页面

#cat /usr/local/work/nginx/nginx.conf

worker_processes 8;

worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;

worker_rlimit_nofile 102400;

events {

use epoll;

multi_accept on;

worker_connections 102400;

}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

tcp_nopush on;

tcp_nodelay on;

keepalive_timeout 60;

server_tokens off;

client_header_buffer_size 2k;

large_client_header_buffers 4 4k;

client_max_body_size 60m;

gzip on;

gzip_min_length 1k;

gzip_buffers 4 16k;

gzip_http_version 1.1;

gzip_comp_level 2;

gzip_types text/plain application/x-javascript text/css application/xml;

upstream tomcats {

server 192.168.1.4:8080;

server 192.168.1.5:8080;

}

server {

listen 443 ssl;

server_name open.baidu.com;

ssl_certificate /usr/local/work/nginx/ssl/nginx.crt;

ssl_certificate_key /usr/local/work/nginx/ssl/nginx.key;

ssl_client_certificate/usr/local/work/nginx/ssl/cacert.pem;

ssl_verify_clienton;

ssl_session_cache shared:SSL:1m;

ssl_session_timeout 5m;

ssl_ciphers HIGH:!aNULL:!MD5;

ssl_prefer_server_ciphers on;

location / {

proxy_pass http://tomcats;

proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;

proxy_set_header Accept-Encoding "";

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;

add_header Front-End-Https on;

proxy_redirect off;

}

}

}

nginx配置反向代理商

配置反向代理商

  • 全部评论(0)
最新发布的资讯信息
【系统环境|服务器应用】树莓派安装TensorFlow(2020-04-24 21:11)
【系统环境|服务器应用】防面试-SD_WebImage(2020-04-24 21:11)
【系统环境|服务器应用】推荐一款视频控件xgplayer(2020-04-24 21:11)
【系统环境|服务器应用】PostgreSQL 源码解读(27)- 查询语句#12(查询优化-上拉子链接#2)(2020-04-24 21:11)
【系统环境|服务器应用】如何轻松学习JavaScript?(2020-04-24 21:10)
【系统环境|服务器应用】【源码剖析】Launcher 8.0 源码 (12) --- Launcher 启动流程 第五步之计算桌面各布局细节参数(2020-04-24 21:10)
【系统环境|服务器应用】前台碰撞室之console.log与文本字符(2020-04-24 21:10)
【系统环境|服务器应用】好用的Middleware实现(2020-04-24 21:10)
【系统环境|服务器应用】前台面试每日 3+1 —— 第373天(2020-04-24 21:10)
【系统环境|服务器应用】绍圣--kafka之生产者(五)(2020-04-24 21:10)
手机二维码手机访问领取大礼包
返回顶部