@phenomlab seems everything is fine? the whole config is a bit complicated with some very very secret things, so I may not able to show it here
G
gili-gili
@gili-gili
Posts
-
Json version of Caddyfile with direct file-serving for built assets -
Json version of Caddyfile with direct file-serving for built assetswait...I can post this topic directly under
technical support
?wow thats an amazing feature
-
Json version of Caddyfile with direct file-serving for built assetssry im busy doing other things
here is the output2023/10/06 15:41:35.986 INFO using provided configuration {"config_file": "Caddyfile.json", "config_adapter": ""} 2023/10/06 15:41:35.991 INFO tls.cache.maintenancestarted background certificate maintenance {"cache": "0xc000435f00"} 2023/10/06 15:41:35.992 INFO http.auto_https enabling automatic HTTP->HTTPS redirects {"server_name": "main"} 2023/10/06 15:41:36.013 INFO tls.cache.maintenancestopped background certificate maintenance {"cache": "0xc000435f00"} Valid configuration
-
Json version of Caddyfile with direct file-serving for built assets{ "match": [ { "host": ["forum.example.com"] } ], "handle": [ { "handler": "subroute", "routes": [ { "handle": [ { "handler": "encode", "encodings": { "gzip": {}, "zstd": {} }, "prefer": ["zstd", "gzip"], "minimum_length": 0 } ] }, { "match": [{ "path": ["/assets/*"] }], "handle": [ { "handler": "subroute", "routes": [ { "handle": [ { "handler": "rewrite", "strip_path_prefix": "/assets" } ] }, { "match": [ { "file": { "root": "/home/nodebb", "try_files": [ "/build/public/{http.request.uri.path}", "/public/{http.request.uri.path}" ] } } ], "handle": [ { "handler": "rewrite", "uri": "{http.matchers.file.relative}" } ] } ] } ] }, { "handle": [ { "handler": "reverse_proxy", "upstreams": [{ "dial": "127.0.0.1:4567" }] } ], "terminal": true } ] } ], "terminal": true }
This isn't working, the static files cannot be served properly with 404 not found.
I also triedcaddy adapt
but it printed wrong config.