gpt4 book ai didi

azure - HAProxy 中的 Proxy_pass 等效项

转载 作者:行者123 更新时间:2023-12-02 00:15:18 26 4
gpt4 key购买 nike

HAProxy 中的 Nginx pass_proxy 相当于什么

location /{
proxy_pass https://WebApplication.azurewebsites.net;
}

我尝试测试此配置,但当我指向具有以下配置的任何后端服务器时,如果没有在根目录上使用 ACL(例如使用自签名证书),我会收到 404

    #---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log /dev/log local0
log /dev/log local1 notice
user haproxy
group haproxy
maxconn 16000
stats socket /var/lib/haproxy/stats level admin
tune.bufsize 32768
tune.maxrewrite 1024
tune.ssl.default-dh-param 2048
daemon
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
#---------------------------------------------------------------------
#HAProxy Monitoring Config
#---------------------------------------------------------------------
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
#---------------------------------------------------------------------
# FrontEnd Configuration
#---------------------------------------------------------------------
frontend fe_http_sne_in
bind *:443 ssl crt /etc/ssl/private/mydomain.pem
option forwardfor
default_backend be_default

backend be_default
mode http
option forwardfor
http-request add-header X-Forwarded-For %[src]
server srv02 www.google.com:443 ssl verify none

当我指向使用 bing、google 作为 url 测试的任何后端服务器时,我收到 404 ...

enter image description here

最佳答案

我建议使用以下配置

frontend fe_http_sne_in
bind *:443 ssl crt /etc/ssl/private/mydomain.pem
option forwardfor
use_backend be_sne_insecure if { path_beg /test}
default_backend be_default

backend be_default
...

backend be_sne_insecure
mode http
option forwardfor
http-request replace-header Host .* WebApplication.azurewebsites.net
server srv01 WebApplication.azurewebsites.net:443 ssl verify none

在博客文章中Introduction to HAProxy ACLs acl 解释了吗

关于azure - HAProxy 中的 Proxy_pass 等效项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57142878/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com