0
votes

I am having a hard time trying to get the authentication working from Nginx through a Haproxy for load balancing. I had the configurations written for haproxy.cfg and nginx.conf as shown below respectively. The Haproxy is in front of my nginx server. I was able to get a prompt for username and password when I hit the haproxy server, however when hit enter after filling up the username and password, it returns "403 Forbidden" as a response on the web page.

Does anyone know what could be the correct configuration settings for the haproxy.cfg? Or perhaps a solution? Thanks in advance!!

HAPROXY.cfg

    global
        daemon
        maxconn 256

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

    frontend http-in
        bind *:80
        default_backend servers

    backend servers
        balance roundrobin
        server server1 http://mynginx.test.com:9090 maxconn 32

NGINX.conf

   location /myapp {
    auth_gss on;
    auth_gss_allow_basic_fallback off
    auth_gss_keytab /etc/krb5.keytab
    proxy_pass http://192.168.1.100:8080/link/;
   }
1
Your server line is incorrect. You should change it to be server server1 mynginx.test.com:9090 maxconn 32 - I can't confirm if that will fix your use case but it will at least make something work for you as right now the HAProxy config is invaliddcorbett
Hi, I actually tried that too, still the same issue.jxStackOverflow
Anybody have a solution?jxStackOverflow

1 Answers

0
votes

Found the solution. The reason for the 403 forbidden error is because of my keytab. I need to regenerate a new one use by the haproxy instead of nginx. However, I'm getting 'Access-Control-Allow-Origin'. Could anybody enlighten?