From 9dadd8649be7416ccbbcaaafeef1fa58923291ef Mon Sep 17 00:00:00 2001 From: hvl71 Date: Wed, 19 Oct 2022 19:28:38 +0200 Subject: [PATCH] functional on https://hla01.int:777 but not on 443. Something localhost? --- README.md | 2 +- caddy-gen/app/index.js | 2 +- caddy/Caddyfile | 6 +++--- caddy/docker-compose.yml | 9 ++++++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2fb9570..09ea591 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ cd caddy docker-compose up ``` -Then either navigate to https://foo.test or `curl https://foo.test`. +Then either navigate to https://hla01.int or `curl https://hla01.int`. > Note: the nginx/Caddy examples needs to be stopped before starting this Caddy example diff --git a/caddy-gen/app/index.js b/caddy-gen/app/index.js index 0ebb14f..96ed51f 100644 --- a/caddy-gen/app/index.js +++ b/caddy-gen/app/index.js @@ -2,7 +2,7 @@ const http = require('http') const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); - res.end('Hello world'); + res.end('Hello from HLA'); }); server.listen(process.env.PORT) diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 4f83c4f..be1ab63 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,12 +1,12 @@ -foo.test { +hla01.int { log stdout # Mkcert - https://github.com/FiloSottile/mkcert - tls /root/certs/foo.test.pem /root/certs/foo.test-key.pem + tls /root/certs/hla01.int.pem /root/certs/hla01.int-key.pem proxy / http://web:8080 { transparent header_upstream X-Marotagem true - header_upstream Host "foo.test" + header_upstream Host "hla01.int" } } diff --git a/caddy/docker-compose.yml b/caddy/docker-compose.yml index cbe1983..a7380d8 100644 --- a/caddy/docker-compose.yml +++ b/caddy/docker-compose.yml @@ -6,7 +6,14 @@ services: - ./certs:/root/certs # to sync mkcert certificates to Caddy - ./Caddyfile:/etc/Caddyfile # to mount custom Caddyfile ports: - - "443:2015" + #does not work on my windows 10. Throws 403 auth + #switching to for instance 777 works. Is 443 used by something else? + #netstat -ano + # - "443:2015" + - "777:2015" + # switching to a port above 1024 works: + # https://hla01.int:2016 has a valid cert and is accessible (requires host file entry) + # - "2016:2015" depends_on: - web