1. Caddy version (caddy version
): v2.4.5
2. How I run Caddy:
c. Service/unit/compose file:
FROM caddy:alpine
COPY ./dist /usr/share/caddy
COPY Caddyfile /etc/caddy/Caddyfile
d. My complete Caddyfile or JSON config:
cs.jakubdobos.eu {
root * /usr/share/caddy
route /api* {
uri strip_prefix /api
reverse_proxy 172.19.0.3:3301
}
route {
file_server
try_files {path} /index.html
}
}
a. System environment:
Host OS: alpine-standard-3.14.2-x86_64
Docker: version 20.10.9, build c2ea9bc90bacf19bdbe37fd13eec8772432aca99
b. Command:
it autostarts in the container that I get from the dockerfile specified up
3. The problem I’m having:
curl -v https://cs.jakubdobos.eu/matches
- Trying 95.102.135.240:443…
- Connected to cs.jakubdobos.eu (95.102.135.240) port 443 (#0)
- ALPN, offering h2
- ALPN, offering http/1.1
- successfully set certificate verify locations:
- CAfile: /etc/ssl/certs/ca-certificates.crt
- CApath: none
- TLSv1.3 (OUT), TLS handshake, Client hello (1):
- TLSv1.3 (IN), TLS handshake, Server hello (2):
- TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
- TLSv1.3 (IN), TLS handshake, Certificate (11):
- TLSv1.3 (IN), TLS handshake, CERT verify (15):
- TLSv1.3 (IN), TLS handshake, Finished (20):
- TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
- TLSv1.3 (OUT), TLS handshake, Finished (20):
- SSL connection using TLSv1.3 / TLS_CHACHA20_POLY1305_SHA256
- ALPN, server accepted to use h2
- Server certificate:
- subject: CN=cs.jakubdobos.eu
- start date: Oct 10 09:57:59 2021 GMT
- expire date: Jan 8 09:57:58 2022 GMT
- subjectAltName: host “cs.jakubdobos.eu” matched cert’s “cs.jakubdobos.eu”
- issuer: C=US; O=Let’s Encrypt; CN=R3
- SSL certificate verify ok.
- Using HTTP2, server supports multiplexing
- Connection state changed (HTTP/2 confirmed)
- Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
- Using Stream ID: 1 (easy handle 0x7f9b01f7ba90)
GET /matches HTTP/2
Host: cs.jakubdobos.eu
user-agent: curl/7.79.1
accept: /
- TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
- Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 404
< server: Caddy
< content-length: 0
< date: Sun, 10 Oct 2021 13:38:28 GMT
< - Connection #0 to host cs.jakubdobos.eu left intact
curl -v https://cs.jakubdobos.eu
- Trying 95.102.135.240:443…
- Connected to cs.jakubdobos.eu (95.102.135.240) port 443 (#0)
- ALPN, offering h2
- ALPN, offering http/1.1
- successfully set certificate verify locations:
- CAfile: /etc/ssl/certs/ca-certificates.crt
- CApath: none
- TLSv1.3 (OUT), TLS handshake, Client hello (1):
- TLSv1.3 (IN), TLS handshake, Server hello (2):
- TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
- TLSv1.3 (IN), TLS handshake, Certificate (11):
- TLSv1.3 (IN), TLS handshake, CERT verify (15):
- TLSv1.3 (IN), TLS handshake, Finished (20):
- TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
- TLSv1.3 (OUT), TLS handshake, Finished (20):
- SSL connection using TLSv1.3 / TLS_CHACHA20_POLY1305_SHA256
- ALPN, server accepted to use h2
- Server certificate:
- subject: CN=cs.jakubdobos.eu
- start date: Oct 10 09:57:59 2021 GMT
- expire date: Jan 8 09:57:58 2022 GMT
- subjectAltName: host “cs.jakubdobos.eu” matched cert’s “cs.jakubdobos.eu”
- issuer: C=US; O=Let’s Encrypt; CN=R3
- SSL certificate verify ok.
- Using HTTP2, server supports multiplexing
- Connection state changed (HTTP/2 confirmed)
- Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
- Using Stream ID: 1 (easy handle 0x7f0f40146a90)
GET / HTTP/2
Host: cs.jakubdobos.eu
user-agent: curl/7.79.1
accept: /
- TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
- Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 200
< accept-ranges: bytes
< content-type: text/html; charset=utf-8
< etag: “r0rc3t24y”
< last-modified: Sun, 10 Oct 2021 10:35:53 GMT
< server: Caddy
< content-length: 2770
< date: Sun, 10 Oct 2021 13:39:32 GMT
<
4. Error messages and/or full log output:
5. What I already tried:
So, I swapped things around in the Caddyfile to familiarize myself more with what each directive is doing. I read the docs a few times through and through already and I looked into how the webpack app handles routes, which I haven’t been able to make out, yet. That is why I am turning to this forum, as I hope there lies someone here, who will be able to help me sort this out. The app works, when you do not need to reach any direct links. So worst-case scenario: I will keep using it as-is. But I think my issue is just a dumb one, and I can not properly word what exactly I am experiencing in this setup.
6. Links to relevant resources:
The website: https://cs.jakubdobos.eu