zoukankan      html  css  js  c++  java
  • nginx

    danjan01deiMac:~ danjan01$ cat  /usr/local/etc/nginx/nginx.conf|grep -v '^$'
    worker_processes  1;
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        server {
            listen       8888;
            server_name  localhost;
           location / {
                index  index.html index.htm;
                proxy_pass http://10.253.124.15:8080;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
           }
    }
        server {
            listen       15672;
            server_name  localhost;
           location / {
                index  index.html index.htm;
    proxy_pass http://10.253.124.25:15672;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
           }
    }
        server {
            listen       8081;
            server_name  localhost;
           location / {
                index  index.html index.htm;
                proxy_pass http://10.253.124.94;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
           }
    }
        server {
            listen       12345;
            server_name  localhost;
           location / {
                index  index.html index.htm;
                proxy_pass http://10.253.124.21:80;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
           }
    
          location /zabbix {
                index  index.html index.htm;
                proxy_pass http://10.248.78.193:8080/zabbix;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
          }
          location /jenkins {
                index  index.html index.htm;
                proxy_pass http://10.253.124.15:8080;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
          }
          location /rabbitmq {
                index  index.html index.htm;
                proxy_pass http://10.253.124.25:15672;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
          }
          location /203/8080/druid {
                index  index.html index.htm;
                proxy_pass http://10.248.78.203:8080/druid;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
          }
          location /204/8080/druid {
                index  index.html index.htm;
                proxy_pass http://10.248.78.204:8080/druid;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
          }
          location /205/8080/druid {
                index  index.html index.htm;
                proxy_pass http://10.248.78.205:8080/druid;
                proxy_connect_timeout 3000s;
                proxy_send_timeout 3000s;
                proxy_read_timeout 3000s;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_http_version 1.1;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $host;
                client_max_body_size    100m;
          }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
        }
        include servers/*;
    }
    danjan01deiMac:~ danjan01$

     https://www.cnblogs.com/biglittleant/p/8979852.html

    ##############################################

    参考:

    https://tonybai.com/2018/09/10/setup-service-discovery-and-load-balance-based-on-consul/

    基于consul实现微服务的服务发现和负载均衡

    ##############################################

    部署原理示意图

    参考:https://tonybai.com/2018/09/10/setup-service-discovery-and-load-balance-based-on-consul/

    原理示意图 -- demo 后有个原理说明,我认为这种表达方式让自己和别人都容易理解

  • 相关阅读:
    Python 描述符(descriptor) 杂记
    Celery 使用简介
    异步任务神器 Celery 简明笔记
    高性能框架gevent和gunicorn在web上的应用及性能测试
    Flask + Gunicorn + Nginx 部署
    Mysql查看最大连接数和修改最大连接数
    配置 influxDB 鉴权及 HTTP API 写数据的方法
    Java 字符串拼接 五种方法的性能比较分析 从执行100次到90万次
    linux端口开放指定端口的两种方法
    java自带的监控工具VisualVM一
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/10910241.html
Copyright © 2011-2022 走看看