HAProxy 中的 Proxy_pass 等价物

Ana*_*tit 2 nginx haproxy azure

HAProxy 中 Nginx pass_proxy 的等价物是什么

location /{
    proxy_pass https://WebApplication.azurewebsites.net;
  }
Run Code Online (Sandbox Code Playgroud)

我尝试测试此配置,但是当我指向具有以下配置的任何后端服务器时收到 404,而不在 root 上使用 ACL,例如使用自签名证书

    #---------------------------------------------------------------------
# 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
Run Code Online (Sandbox Code Playgroud)

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

在此处输入图片说明

Ale*_*dar 5

我建议使用以下配置

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
Run Code Online (Sandbox Code Playgroud)

在博客文章HAProxy ACL 简介中解释了 acl