How can i achieve nginx proxy_pass $scheme://$http_host$uri$is_args$args; in haproxy


#1

How can i achieve nginx proxy_pass $scheme://$http_host$uri$is_args$args; in haproxy


#2

Is this possible achieve this in haproxy?


#3

You don’t have to do anything like this, haproxy will pass the request as is to the backend.


#4

I don’t want hard code any back end server… is it possible to forward whatever request through pxoxy.?


#5

Hi,

Can you help me how to configure without hardcoding bakend server?


#6

Where do you want the HTTP request to be forwarded to if you don’t configure a backend server?


#7

My Nginx Configuration:
#transparent http proxy
server {
listen 10.200.210.32:6090;
server_name localhost;
access_log off;

    location / {
        proxy_http_version 1.1;
        proxy_pass $scheme://$http_host$uri$is_args$args;
    }

}

For HaPxoxy: How can can it be done without hardcoding beckend server…by only forwarding to hdr(host)?


#8

You cannot do this with haproxy. Haproxy is not a forwarding proxy (neither is nginx).


#9

global
daemon
maxconn 256

defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms

frontend http-in
bind 192.168.192.35:6090 transparent
default_backend servers

backend servers
server server1 10.58.187.153:80 maxconn 32

backend Forward address is keep on changing for my case…so I don’t want to change the back end server every time and restart the haproxy…

In nginx case I don’t need to do anything…it works with default http_host…

Pls suggest me any way I can do it same way in haproxy?


#10

Like I said, its not possible. This is not what haproxy was made for. Haproxy is a reverse proxy.