HTTP 404 errors in file_server for specific routes

You are right, the reason for using css and js paths is because i dont want caddy to serve all html pages. I want that to be handled by the code [in this case, jetty]

Regarding the / thing,

	route / {
		file_server {
			root /etc/caddy/web 
			index index.html
		}

		header / {
			Cache-Control "public, max-age=31536000" # Cache for 1 year
		}
	}

So if user goes to the root of the domain, then serve a static page to the user. No auth needed here. Which is why im using caddy and not my java code.

For any other paths, which other than the root path make is proxy to java hence this. The code checks if the request is authenticated or not so the code is going to serve pages based on authentication.

	route /* {
		reverse_proxy localhost:8091
	}

The issue is resolved. Caddy is running fine. The main culprit was the cloudflare cache

1 Like