Nginx Error Logs after Mautic install #510

Closed
opened 2026-04-05 20:28:02 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @dd05252 on 8/13/2022

CloudPanel version(s) affected

2

Description

Not sure if this is a bug, but I followed the cloudpanel install guide for Mautic.
The install instructions work fine and the application installs correctly but I get nginx errors in the log file.

No site data is being tracked in Mautic.

Error.
"2022/08/12 23:12:22 [error] 119853#119853: *271 open() "/home/user/htdocs/mysite.com/mtc.js" failed (2: No such file or directory), client: 114.75.114.208, server: mysite, request: "GET /mtc.js HTTP/2.0", host: "mysite.com", referrer: "https://mysite.com/".

Is it possible that the vhost template is incorrect for a Mautic install?

I have looked at other install instructions online for Mautic/Nginx installs and they all seem to reference a rewrite of some sort for the mtc.js file.

For example,

location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) {
       # default_type "application/javascript";
       try_files $uri /index.php$is_args$args;
   }

another example

location ~ /(mtc\.js|mtracking.gif|mtc) {
		# default_type "application/javascript";
		try_files $uri /index.php$is_args$args;
	}

Also found this post, https://github.com/stevedrobinson/better-mautic-nginx/blob/master/mautic.conf.

How to reproduce

Tried 2 fresh installs on ubuntu 22.04 servers.
Installed cloudpanel.
Installed Mautic as per cloudpanel documentation.
Same result.

Possible Solution

Create a Vhost template specifically for Mautic installations.

Additional Context

No response

*Originally created by @dd05252 on 8/13/2022* ### CloudPanel version(s) affected 2 ### Description Not sure if this is a bug, but I followed the cloudpanel install guide for Mautic. The install instructions work fine and the application installs correctly but I get nginx errors in the log file. No site data is being tracked in Mautic. Error. "2022/08/12 23:12:22 [error] 119853#119853: *271 open() "/home/user/htdocs/mysite.com/mtc.js" failed (2: No such file or directory), client: 114.75.114.208, server: mysite, request: "GET /mtc.js HTTP/2.0", host: "mysite.com", referrer: "https://mysite.com/". Is it possible that the vhost template is incorrect for a Mautic install? I have looked at other install instructions online for Mautic/Nginx installs and they all seem to reference a rewrite of some sort for the mtc.js file. For example, ``` location ~ /(mtc.js|1.js|mtracking.gif|.*\.gif|mtc) { # default_type "application/javascript"; try_files $uri /index.php$is_args$args; } ``` another example ``` location ~ /(mtc\.js|mtracking.gif|mtc) { # default_type "application/javascript"; try_files $uri /index.php$is_args$args; } ``` Also found this post, https://github.com/stevedrobinson/better-mautic-nginx/blob/master/mautic.conf. ### How to reproduce Tried 2 fresh installs on ubuntu 22.04 servers. Installed cloudpanel. Installed Mautic as per cloudpanel documentation. Same result. ### Possible Solution Create a Vhost template specifically for Mautic installations. ### Additional Context _No response_
Sign in to join this conversation.