authorizer icon indicating copy to clipboard operation
authorizer copied to clipboard

Caddyfile

Open VladimirCores opened this issue 3 years ago • 6 comments

Feature Description It would be great to have Caddyfile and caddy service in docker-compose which exposes authorizer service to https.

VladimirCores avatar Feb 15 '23 09:02 VladimirCores

Strange but this settings does not work:

localhost:443 {
	handle /auth/* {
		reverse_proxy authorizer:4444
	}
	handle / {
		respond "root empty"
	}
}
localhost:80 {
	respond "HTTP is not available use HTTPS"
}

VladimirCores avatar Feb 15 '23 10:02 VladimirCores

docker-compose.yaml

version: '3.9'
services:
  authorizer:
    container_name: authorizer
    build: .
    ports:
      - "4444:8080"
    env_file:
      - .env
  caddy:
    image: caddy:latest
    restart: unless-stopped
    container_name: caddy
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./caddy:/etc/caddy
    links:
      - "authorizer"

VladimirCores avatar Feb 15 '23 16:02 VladimirCores

@VladimirCores thank you for sharing this. I will update it.

lakhansamani avatar Feb 15 '23 16:02 lakhansamani

With subdomain all works:

auth.localhost {
	reverse_proxy authorizer:8080
}
localhost:80 {
	respond "HTTP is not available use HTTPS"
}

VladimirCores avatar Feb 15 '23 17:02 VladimirCores

Oh man, trying your system for second time and faced so many problems, things that not documented. It works localhost but when serving from cloud VPS facing a lot of problems.

Uncaught DOMException: Failed to execute 'postMessage' on 'Window': Invalid target origin '/app' in a call to 'postMessage'.

VladimirCores avatar Feb 15 '23 19:02 VladimirCores

@VladimirCores can you pls share reproducible steps so that we can debug and fix it.

Thanks

lakhansamani avatar Feb 16 '23 01:02 lakhansamani