美文网首页
Nginx反向代理https请求

Nginx反向代理https请求

作者: 莫夏_b560 | 来源:发表于2020-06-10 14:37 被阅读0次

    现有的应用场景:公有云服务,请求私有云服务,需要通过P5服务代理到私有云,


    image.png

    我们需要在公有云服务,构建https请求,并通过外联机,代理到P5前置机。这里需要代理https服务到P5前置机上。

    1、haproxy代理

    2、nginx代理:stream

    worker_processes 1;
    
    events {
        
        worker_connections 2048;
    }
    
    stream {
          log_format  access_log_format  '$remote_addr - $remote_user [$time_local] "$request" '
                                        '$status $body_bytes_sent "$http_referer" '
                                        '"$http_user_agent" "$http_x_forwarded_for"';
    
          upstream p5_pl3 {
                server 128.123.179.134:88889 weight=10;
        }
    
          server {
              listen 8889;
              proxy_pass p5_pl3;
              proxy_connect_timeout 10s;
              access_log /home/ap/web/nginx/logs/access.log access_log_format;
              error_log  /home/ap/web/nginx/logs/error.log;
        }
    }
    

    相关文章

      网友评论

          本文标题:Nginx反向代理https请求

          本文链接:https://www.haomeiwen.com/subject/ywtnuctx.html