• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

2、nginx+tomcat反向代理和负载均衡--CentOS 7

武飞扬头像
KeithQin
帮助1

#修改ngnix.conf文件添加以下内容

vim /usr/local/ngnix/conf/ngnix.conf

学新通

   

  1.  
    upstream backend {
  2.  
    server 192.168.31.167:8081;
  3.  
    server 192.168.31.68:8080;
  4.  
    #server 192.168.31.68:8080 weight=1 max_fails=1 fail_timeout=10s;
  5.  
    }
  6.  
    server {
  7.  
    listen 80;
  8.  
    server_name localhost;
  9.  
    #charset koi8-r;
  10.  
    #access_log logs/host.access.log main;
  11.  
    # location / {
  12.  
    # proxy_pass http://backend;
  13.  
    # root html;
  14.  
    # index index.html index.htm;
  15.  
    # }
  16.  
    location /mis/ {
  17.  
    proxy_set_header Host $http_host;
  18.  
    proxy_set_header X-Real-IP $remote_addr;
  19.  
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  20.  
    proxy_set_header X-NginX-Proxy true;
  21.  
    proxy_send_timeout 310s;
  22.  
    proxy_read_timeout 310s;
  23.  
    proxy_pass http://backend/mis/;
  24.  
    }
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhggbhie
系列文章
更多 icon
同类精品
更多 icon
继续加载