Serving HTTPS on port 443
https://jossecottenier.tech
Serving HTTP on port 80
http://jossecottenier.tech
WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with `ulimit -n 8192`.
nohup.out of test directory:
Activating privacy features... done.
Serving HTTP on port 2020
http://localhost:2020
Activating privacy features... done.
Serving HTTP on port 2020
http://localhost:2020
WARNING: File descriptor limit 1024 is too low for production servers. At least 8192 is recommended. Fix with `ulimit -n 8192`.
Output of curl -IL localhost:2020:
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 2332
Content-Type: text/html; charset=utf-8
Etag: "pzl43o1ss"
Last-Modified: Fri, 18 Oct 2019 19:14:12 GMT
Server: Caddy
Date: Sat, 19 Oct 2019 13:54:56 GMT
Output of curl -IL localhost:2020/test (actually ‘/ilias’ because ‘test’ was just a placeholder name):
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
Server: Caddy
X-Content-Type-Options: nosniff
Date: Sat, 19 Oct 2019 13:56:30 GMT
Content-Length: 14
Output of curl -ILH "Host:jossecottenier.tech" localhost/test (actually /ilias):
HTTP/1.1 301 Moved Permanently
Connection: close
Content-Type: text/html; charset=utf-8
Location: https://jossecottenier.tech/ilias
Server: Caddy
Date: Sat, 19 Oct 2019 13:58:21 GMT
HTTP/2 404
content-type: text/plain; charset=utf-8
date: Sat, 19 Oct 2019 13:58:21 GMT
server: Caddy
server: Caddy
x-content-type-options: nosniff
content-length: 14
Ahh, I see, you’ve got two Caddy servers and the backend Caddy at 2020 is just serving files?
By proxying /ilias to the secondary Caddy server, that server is seeing a request for /ilias - but it’s web root is ./ilias - so it’s trying to find a file in ./ilias/ilias relative to the main Caddy and finding nothing - make sense?
Ditch the backend Caddy server and remove the proxy. The “main” Caddy server can serve files out of the subdirectory automatically.