Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Getting BADREQ 408 only externally

$
0
0

@shlomi wrote:

Hi, Recently I installed HAProxy as a reverse proxy only.
When I use it internally inside my LAN, everything works perfect.
When I use it externally, I get 408 BADREQ.
I made 2 simple firewall rules:
Policy:
Source: Any - Destination: HAProxy_External_IP & Internal IP - Service: Any - Accept
NAT:
Destination: HAProxy_External_IP - Destination Port: Any - Destination IP: HAProxy_Internal_IP - Service port: Original

When I browse to my URL, I get this error in haproxy.log:

Mar 26 01:29:42 localhost haproxy[13266]: 212.xxxxx0:56170 [26/Mar/2019:01:28:52.760] http-in http-in/ -1/-1/-1/-1/50001 408 213 - - cR-- 0/0/0/0/0 0/0 “”
Mar 26 01:29:42 localhost haproxy[13266]: 212.xxxxx0:56170 [26/Mar/2019:01:28:52.760] http-in http-in/ -1/-1/-1/-1/50001 408 213 - - cR-- 0/0/0/0/0 0/0 “”

My HaProxy Config:

global
log 127.0.0.1:514 local0 info
log 127.0.0.1:514 local1 notice
tune.maxrewrite 16384
tune.bufsize 32768
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon

defaults
log global
mode http
option forwardfor
option http-server-close
option httplog

option dontlognull

    timeout connect 5000
    timeout client  50000
    timeout server  50000
    errorfile 400 /etc/haproxy/errors/400.http
    errorfile 403 /etc/haproxy/errors/403.http
    errorfile 408 /etc/haproxy/errors/408.http
    errorfile 500 /etc/haproxy/errors/500.http
    errorfile 502 /etc/haproxy/errors/502.http
    errorfile 503 /etc/haproxy/errors/503.http
    errorfile 504 /etc/haproxy/errors/504.http

frontend http-in
log 127.0.0.1:514 local0 debug
bind *:80

    # Define hosts
    acl host_1 hdr(host) -i test.prv.com
    acl host_2 hdr(host) -i test.prv.com

    ## figure out which one to use
    use_backend back1 if host_1
    use_backend back2 if host_2

backend back1
log 127.0.0.1:514 local0 debug
balance leastconn
option httpclose
option forwardfor
cookie JSESSIONID prefix
server node1 192.168.30.103:80 cookie A check

backend back2
log 127.0.0.1:514 local0 debug
server node1 google.com:80

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>