Hi, could you please help me resolve an issue with MIME?
After installing a local AI package on my cloud server, I am able to access it directly via the server IP. However, when I try to access it via my subdomain, I get a MIME error:
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “”. Strict MIME type checking is enforced for module scripts per HTML spec.
I have attempted to modify my Caddyfile, but the issue persists. After spending over 8 hours investigating, I am unable to resolve it.
I would assume something like this in this first block:
{
# Global options - works for both environments
email {$LETSENCRYPT_EMAIL}
# Ensure correct MIME types for JavaScript files
mime .js application/javascript
}
Unfortunately Caddy is restarting all the time because it is not recognizing mime.
Log:
{“level”:“info”,“ts”:1742731548.627021,“msg”:“using config from file”,“file”:“/etc/caddy/Caddyfile”}
Error: adapting config using caddyfile: /etc/caddy/Caddyfile:5: unrecognized global option: mime
ah ok, sry. looks like this is not the correct syntax then for caddy. I searched more, but I also just found then the solution you got with the header.
its a bit different then yours. maybe just try this caddyfile (I dont have a testenvironment, so I cant verfiy at the moment myself).
Checked this out but MIME does not give up and still blocking frontend:
“Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “”. Strict MIME type checking is enforced for module scripts per HTML spec.”
To be honest I don’t mind using direct IP to the server - i will block other incoming traffic but crucial app which is N8N now is not working due to HTTPS.
I added N8N_SECURE_COOKIE in env file but does not work.
Should I put in different folder to access ?
Still nothing
I tired even cloning just n8n but there was also a problem when I wanted to update a container with env.
Guess I have to spend some time recreate whole packaged locally and then try to repair but thank you so much for your immediate support and understanding