0

I am strugling with my Configuration for a while now and i always get the Redirect Loop error in Browser. I am running Caddy in docker and an Angular Application with the nginx image also in Docker. When i am calling my URL in the Browser i get the to many redirects error, i am getting redirected from https to http and back to https until i get the NS_ERROR_REDIRECT_LOOP.

What am i doing wrong?

Caddyfile:

hotel.luluflu.com {
    reverse_proxy hotel-client:80
}

nginx.conf:

events {
    worker_connections  1024;
}
http {
    include /etc/nginx/mime.types;
    server {
        client_max_body_size 128M;
        listen 80 default_server;
        server_name ${HOTEL_CLIENT_NAME}
        listen [::]:80 default_server;
        root   /usr/share/nginx/html;
        location /api {
            proxy_pass ${HOTEL_CLIENT_SERVER_URL};
        }
        location / {
             try_files $uri $uri/ /index.html;
          }

    }
}

Setup:

  • caddy version 2.7
  • Nginx Version: 1.27.3

Browser log: Browser Log

I hope anybody can help, btw, i can ping the client container from caddy container.

2
  • From what I see at your screenshot, it is your Caddy server redirecting you from https://hotel.luluflu.com to http://hotel.luluflu.com. Commented Jan 3 at 11:00
  • Hi Ivan, thanks for the input. I guess thats what is happening. I just ran whoami container and it works fine with same configuration. Commented Jan 3 at 11:23

1 Answer 1

0

If anybody has this problem, i could fix it by deleting a container that was interfering with the Proxy. It was the same container but with a different name, that i forgot it was still there. After i deleted this container the proxy forwarded my request to the correct container only and it works fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.