Correct way to serve .mjs files with proper MIME type on HestiaCP (Nextcloud)

Hi everyone,

I’m running a Nextcloud instance on a HestiaCP-managed server and I’m getting the following warning:

“Your webserver does not serve .mjs files using the JavaScript MIME type. This will break some apps by preventing browsers from executing the JavaScript files. You should configure your webserver to serve .mjs files with either the text/javascript or application/javascript MIME type.”

I’d like to fix this using the HestiaCP panel only — without editing config files manually via SSH, if possible.

So my question is:

:backhand_index_pointing_right: What is the proper way to serve .mjs files with the correct MIME type (text/javascript) via HestiaCP?
Should I add something in the “Additional Nginx directives” or the “Apache directives” section for the domain?
If yes, what exactly should I write and where?

Thanks in advance for your help!
Best regards,

Hi, so this is the complexity of nextcloud, but here’s a solution for you)

1 Like

Good! Thanks