How to set up ".mjs" MIME Type for the templates

In the last couple of days I read a lot about the templates in HestiaCP for nginx, apache2 and php-fpm but I really don`t understand some things:

My nextcloud installation logs the error “.mjs MIME Type Problem” and I tried to fix it by editing the templates.

First I found some guides to edit it in advanced options in HestiaCP Webpanel but I dont have any advanced options which allows me to edit “default” template of Apache2 or add a new template.

Even if i add a new template via command line, it will be not listed under the dropdown of Apache2.

So I decided to edit the default.tpl and default.stpl of apache2 and nginx with follwoing instructions:

Apache2:
AddType application/javascript .mjs

Nginx:
types {
application/javascript mjs;
}

And rebuild the user and domains (and all). But it doesnt take effect in my opinion.

I tried to understand how the templates work (I know how the packages are working and this is doing fine) and saw all “tpl” and “stpl” of the folder nginx are listed in nginx dropdown, same for PHP-fpm but not for apache2?

Can someone help me? I wanna learn all this stuff but I sometimes I dont find the answers on the web.

Thansk

addition, i added the mjs support in the conf files aswell: /home/user/conf/web/…

Will get overwritten if you rebuild the website make sure to use the template:

1 Like

Sorry this isnt the answer who ever marked it as answer, I used the templates and did all the stuff from the guide and documentation. This alsow does not answer my question to learn hwo the templates are working and why the templates are not listed in apache2 drop down

1 Like

SOLUTION (also for empty Contacts and Activity on Nextcloud):

If you have any web application which errors in “mjs support not found” just add following to the mime.types in nginx:

sudo nano /etc/nginx/mime.types

add:

application/javascript    mjs;

restart the nginx

sudo systemctl restart nginx

Done be happy <3

1 Like