# Form won't show via javascrip - 404 not found

**URL:** <https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477>\
**Category:** Product Support\
**Created:** [September 15, 2017, 6:15am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477 "2017-09-15T06:15:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 15, 2017, 6:15am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/1 "2017-09-15T06:15:13Z")

</div>

I’m trying to add a mautic form to my site via javascript. But the form won’t show.

Code:

When I click to the link https://mt.fususu.com/form/generate.js?id=5 it just show a 404 file not found.  
It also happen to mt.fususu.com/mtc.js and the tracking code won't work as well.  
I've search around and tried these fixes below, but not work.  
1. [Checking install base url](https://www.mautic.org/community/index.php/7552-v-2-8-0-404-on-mautic-form-js/0)  
2. [Add some code in the nginx config.](https://www.mautic.org/community/index.php/4626-mtc-js-not-found/0)  
  
I installed Mautic on a VPS, nginx 1.12/ php 7.1. Below is my current virtualhost  

Code:

server { listen 80; server\_name mt.fususu.com; rewrite ^(.\*) https://mt.fususu.com$1 permanent; }

server {  
listen 443 ssl http2;

```
# access_log off;
access_log /home/mt.fususu.com/logs/access.log;
# error_log off;
	error_log /home/mt.fususu.com/logs/error.log;

   # some ssl certificate code here 

	root /home/mt.fususu.com/public_html;
index index.php index.html index.htm;
	server_name mt.fususu.com;

location / {
	try_files $uri $uri/ /index.php?$args;

	
}

# Custom configuration
include /home/mt.fususu.com/public_html/*.conf;

	location ~ .php$ {
	fastcgi_split_path_info ^(.+.php)(/.+)$;
    	include /etc/nginx/fastcgi_params;
    	fastcgi_pass 127.0.0.1:9000;
    	fastcgi_index index.php;
	fastcgi_connect_timeout 1000;
	fastcgi_send_timeout 1000;
	fastcgi_read_timeout 1000;
	fastcgi_buffer_size 256k;
	fastcgi_buffers 4 256k;
	fastcgi_busy_buffers_size 256k;
	fastcgi_temp_file_write_size 256k;
	fastcgi_intercept_errors on;
    	fastcgi_param SCRIPT_FILENAME /home/mt.fususu.com/public_html$fastcgi_script_name;
	}
	
location /nginx_status {
	stub_status on;
	access_log off;
	allow 127.0.0.1;
	deny all;
}
location /php_status {
	fastcgi_pass 127.0.0.1:9000;
	fastcgi_index index.php;
	fastcgi_param SCRIPT_FILENAME /home/mt.fususu.com/public_html$fastcgi_script_name;
	include /etc/nginx/fastcgi_params;
	allow 127.0.0.1;
	deny all;
	}
location ~ /. {
	deny all;
}
    location = /favicon.ico {
            log_not_found off;
            access_log off;
    }
   location = /robots.txt {
	allow all;
	log_not_found off;
	access_log off;
   }
location ~* .(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|woff2|ttf|woff)$ {
        gzip_static off;
	add_header Pragma public;
	add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	access_log off;
	expires 30d;
	break;
    }

    location ~* .(txt|js|css)$ {
        add_header Pragma public;
	add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	access_log off;
	expires 30d;
	break;
    }
	
	
		
location ~ mtc.js{
  try_files $uri @phpstream;
}

location ~ generate.js{
  try_files $uri @phpstream;
}

location @phpstream {
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}	

}

```

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 15, 2017, 6:15am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/2 "2017-09-15T06:15:13Z")

</div>

I’m trying to add a mautic form to my site via javascript. But the form won’t show.

```auto
<script type="text/javascript" src="//mt.fususu.com/form/generate.js?id=5"></script>
```

When I click to the link [https://mt.fususu.com/form/generate.js?id=5](https://mt.fususu.com/form/generate.js?id=5) it just show a 404 file not found.  
It also happen to [mt.fususu.com/mtc.js](http://mt.fususu.com/mtc.js) and the tracking code won’t work as well.  
I’ve search around and tried these fixes below, but not work.

1. [Checking install base url](https://www.mautic.org/community/index.php/7552-v-2-8-0-404-on-mautic-form-js/0)
2. [Add some code in the nginx config.](https://www.mautic.org/community/index.php/4626-mtc-js-not-found/0)

I installed Mautic on a VPS, nginx 1.12/ php 7.1. Below is my current virtualhost

```auto
server {
	listen 80;
	server_name mt.fususu.com;
	rewrite ^(.*) https://mt.fususu.com$1 permanent;
    	}
		
server {
	listen 443 ssl http2;
		
	# access_log off;
	access_log /home/mt.fususu.com/logs/access.log;
	# error_log off;
    	error_log /home/mt.fususu.com/logs/error.log;
	
       # some ssl certificate code here 

    	root /home/mt.fususu.com/public_html;
	index index.php index.html index.htm;
    	server_name mt.fususu.com;
 
   	location / {
		try_files $uri $uri/ /index.php?$args;

		
	}
	

	# Custom configuration
	include /home/mt.fususu.com/public_html/*.conf;
 
    	location ~ .php$ {
		fastcgi_split_path_info ^(.+.php)(/.+)$;
        	include /etc/nginx/fastcgi_params;
        	fastcgi_pass 127.0.0.1:9000;
        	fastcgi_index index.php;
		fastcgi_connect_timeout 1000;
		fastcgi_send_timeout 1000;
		fastcgi_read_timeout 1000;
		fastcgi_buffer_size 256k;
		fastcgi_buffers 4 256k;
		fastcgi_busy_buffers_size 256k;
		fastcgi_temp_file_write_size 256k;
		fastcgi_intercept_errors on;
        	fastcgi_param SCRIPT_FILENAME /home/mt.fususu.com/public_html$fastcgi_script_name;
    	}
		
	location /nginx_status {
  		stub_status on;
  		access_log off;
		allow 127.0.0.1;
		deny all;
	}
	location /php_status {
		fastcgi_pass 127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME /home/mt.fususu.com/public_html$fastcgi_script_name;
		include /etc/nginx/fastcgi_params;
		allow 127.0.0.1;
		deny all;
    	}
	location ~ /. {
		deny all;
	}
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }
       location = /robots.txt {
		allow all;
		log_not_found off;
		access_log off;
       }
	location ~* .(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|woff2|ttf|woff)$ {
	        gzip_static off;
		add_header Pragma public;
		add_header Cache-Control "public, must-revalidate, proxy-revalidate";
		access_log off;
		expires 30d;
		break;
        }

        location ~* .(txt|js|css)$ {
	        add_header Pragma public;
		add_header Cache-Control "public, must-revalidate, proxy-revalidate";
		access_log off;
		expires 30d;
		break;
        }
		
		
			
	location ~ mtc.js{
      try_files $uri @phpstream;
    }
	
	location ~ generate.js{
      try_files $uri @phpstream;
    }
	
	location @phpstream {
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
	}	
	
	}

```

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 15, 2017, 3:41pm UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/3 "2017-09-15T15:41:39Z")

</div>

Up, anyone can fix this before?

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 21, 2017, 8:29am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/4 "2017-09-21T08:29:33Z")

</div>

Hi there?

---

<div class="post-metadata">

**Author:** ![Alcides](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Alcides](https://forum.mautic.org/u/Alcides)\
**Post date:** [September 26, 2017, 7:26pm UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/5 "2017-09-26T19:26:56Z")

</div>

hi! @fususu

I am facing the same issue.  
I am using the following extra setup for Mautic.

My issue is that CSS and JS files are not beeing load.  
I am new with NGINX, I have no idea in which direction should I go.

Did you solve it?

Thanks.

* * *

##### START - Mautic Configuration

```
# redirect index.php to root
	rewrite ^/index.php/(.*) /$1 permanent;
	
# redirect some entire folders
	rewrite ^/(vendor|translations|build)/.* /index.php break;

# ---- START - Mautic Protections ---- #
	
  #Deny everything else in /app folder except Assets folder in bundles
	location ~ /app/bundles/.*/Assets/ {
		allow all;
		access_log off;
	}
	location ~ /app/ {
		deny all;
	}

  #Deny everything else in /addons or /plugins folder except Assets folder in bundles
	location ~ /(addons|plugins)/.*/Assets/ {
		allow all;
		access_log off;
	}
	location ~ /(addons|plugins)/ {
		deny all;
	}

  #Deny all php files in themes folder
	location ~* ^/themes/(.*).php {
		deny all;
	}

  #Don't log favicon
	# It is not necessary because it is already in /usr/local/nginx/conf/drop.conf
	# I am using centminmod.com
	#location = /favicon.ico {
	#	log_not_found off;
	#	access_log off;
	#}

  #Don't log robots
	# It is not necessary because it is already in /usr/local/nginx/conf/drop.conf
	# I am using centminmod.com
	#location = /robots.txt {
	#	access_log off;
	#	log_not_found off;
	#}

  #Deny yml, twig, markdown, init file access
	location ~* /(.*).(?:markdown|md|twig|yaml|yml|ht|htaccess|ini)$ {
		deny all;
		access_log off;
		log_not_found off;
	}

  #Deny all attempts to access hidden files/folders such as .htaccess, .htpasswd, .DS_Store (Mac), etc...
	location ~ /. {
		deny all;
		access_log off;
		log_not_found off;
	}

  #Deny all grunt, composer files
	location ~* (Gruntfile|package|composer).(js|json)$ {
		deny all;
		access_log off;
		log_not_found off;
	}
	
  #Allowing the file manager to execute
	location ~ /app/bundles/CoreBundle/Assets/js/libraries/ckeditor/filemanager/connectors/php/filemanager.php {
		allow all;
	}

# ---- END - Mautic Protections ---- #

```

location / {  
# First attempt to serve request as file, then as directory, then fall back to index  
try\_files $uri $uri/ /index.php$is\_args$args;  
}

##### END - Mautic Configuration

* * *

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 27, 2017, 1:22am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/6 "2017-09-27T01:22:37Z")

</div>

Hi @Alcides  
Unfortunately I haven’t solved it yet. And this caused the email tracking function not working, too.  
But I know for sure it’s the config nginx problem. Due to some restrict config, that nginx looking for the particular file mtc.js, and if not found it give the 404 error, while Mautic using the dynamic content, it will call that file via PHP script.  
So I tried to pass the mtc.js file to the php via 127.0.0.1:9000 by these code, but no luck ☹

```auto
location ~ mtc.js{
      try_files $uri @phpstream;
    }
location @phpstream {
    fastcgi_pass fastcgi_pass 127.0.0.1:9000;
	}
```

It may work if we pass the php to listen to sock, instead of the ip like this [https://stackoverflow.com/questions/44757189/where-is-php7-0-fpm-sock-located](https://stackoverflow.com/questions/44757189/where-is-php7-0-fpm-sock-located) but I’m not trying yet.

---

<div class="post-metadata">

**Author:** ![Alcides](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Alcides](https://forum.mautic.org/u/Alcides)\
**Post date:** [September 27, 2017, 7:33pm UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/7 "2017-09-27T19:33:33Z")

</div>

@fususu

I got what you have said.  
Today I rebuild my server completelly to exclude any past mistake but the issue is still there.

I tryied HTTP and HTTPS and the results are the same.

I have no idea for while how to solve it. If you have, please, let me know.  
Thanks a lot.

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 28, 2017, 4:43am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/8 "2017-09-28T04:43:30Z")

</div>

@alcides Not any luck. I’m hiring some guys here to help [https://www.freelancer.com/projects/linux/fix-issue-when-using-mautic/#/proposals](https://www.freelancer.com/projects/linux/fix-issue-when-using-mautic/#/proposals) , minimum is 21$ :)) can we share? maybe he will fix for both of us.

---

<div class="post-metadata">

**Author:** ![Alcides](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Alcides](https://forum.mautic.org/u/Alcides)\
**Post date:** [September 28, 2017, 2:53pm UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/9 "2017-09-28T14:53:49Z")

</div>

hi! @fususu

Sure If the person really find the reason knowing what they are doing I can share it.

Please tell me about your server environment setup.

Mine is very simple:  
1 - CentOS 7  
2 -LEMP install script ([https://centminmod.com](https://centminmod.com)) version 123.09beta01

OBS: I decided to use this version instead of the 123.08stable just because the new one has the hability to auto add a Let’s Encrypt SSL to a virtualhost setup.

Have you tested it?

Thanks,

---

<div class="post-metadata">

**Author:** ![Alcides](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Alcides](https://forum.mautic.org/u/Alcides)\
**Post date:** [September 28, 2017, 3:11pm UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/10 "2017-09-28T15:11:52Z")

</div>

Hi! @fususu

Based on this post: [https://www.mautic.org/community/index.php/5944-e-mail-open-tracking-404/0#p16733](https://www.mautic.org/community/index.php/5944-e-mail-open-tracking-404/0#p16733)

I believe I could solve it my adding the lines bellow:  
The 404 Error is not anymore but I sill have some CSS load errors.

* * *

# Solve e-Mail Open Tracking 404 Error

```
location ~ email/(.*).gif {
	try_files $uri /index.php?$args;
	}

```

# Solve JS Loading 404 Error

```
location ~ (.*).js {
	try_files $uri /index.php?$args;
	}

```

* * *

Please, have a look if it can solve also your issue.

Best regards!

Alcides

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 29, 2017, 7:42am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/11 "2017-09-29T07:42:46Z")

</div>

[quote=26216:@Alcides]Hi! @fususu

* * *

# Solve e-Mail Open Tracking 404 Error

```
location ~ email/(.*).gif {
	try_files $uri /index.php?$args;
	}

```

# Solve JS Loading 404 Error

```
location ~ (.*).js {
	try_files $uri /index.php?$args;
	}

```

* * *

[/quote]

I tried this before but not work. I’m using Centos 7 and LEMP just like you.  
Still waiting for the miracle happens…

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [September 29, 2017, 9:04am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/12 "2017-09-29T09:04:52Z")

</div>

Hey, after one hour messing around with the nginx config I found the root cause of my problem and solved it!  
Here is what I did:

1. I notice that when visit [mydomain.com/whatever](http://mydomain.com/whatever) --\> it show a mautic 404 page. but when visit [mydomain.com/mtc.js](http://mydomain.com/mtc.js) it show just a 404 of Nginx ==\> it must be some pre-configs related to that the file js causes this.
2. Then I search in my nginx config and see that there is another block that config the css & js file:

```auto
 location ~* .(txt|js|css)$ {
	      add_header Pragma public;
	     add_header Cache-Control "public, must-revalidate, proxy-revalidate";
		access_log off;
		expires 30d;
		break;
        }
```

1. I just comment all the code. Then the miracle appeared! 404 not found of mydomain/mtc.js gone!

P.s. I also add these code below to config the js & gif file

```auto
              # Solve email tracking pixel not found
		location ~ email/(.*).gif {
		try_files $uri /index.php?$args;
		}
		# Solve JS Loading 404 Error
		location ~ (.*).js {
		try_files $uri /index.php?$args;
		}
```

P.p.s. this solution also help me solve open mail tracking issues. I just delete |gif from the code in my pre-config

`location ~* .(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|woff2|ttf|woff)$ {
	        gzip_static off;
		add_header Pragma public;
		add_header Cache-Control "public, must-revalidate, proxy-revalidate";
		access_log off;
		expires 30d;
		break;
        }`

---

<div class="post-metadata">

**Author:** ![arjon](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@arjon](https://forum.mautic.org/u/arjon)\
**Post date:** [October 26, 2017, 4:38pm UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/13 "2017-10-26T16:38:22Z")

</div>

@fususu Can you please publish the full mautic config for nginx?

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [October 27, 2017, 7:45am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/14 "2017-10-27T07:45:33Z")

</div>

> [@26743:@arjon](#):
>
> @fususu Can you please publish the full mautic config for nginx?

Here is my full nginx that works well with mautic now, also using SSL.

```auto
server {
	listen 80;
	
	server_name subdomain.mydomain.com;
	rewrite ^(.*) https://subdomain.mydomain.com$1 permanent;
    	}
		
server {
	listen 443 ssl http2;
		
	# access_log off;
	access_log /home/subdomain.mydomain.com/logs/access.log;
	# error_log off;
    	error_log /home/subdomain.mydomain.com/logs/error.log;
	
    	root /home/subdomain.mydomain.com/public_html;
	index index.php index.html index.htm;
    	server_name subdomain.mydomain.com;

#( some SSL related was removed )
 
    	location / {
		try_files $uri $uri/ /index.php?$args;
		
	}
	
	# Custom configuration
	include /home/subdomain.mydomain.com/public_html/*.conf;
 
    	location ~ .php$ {
		fastcgi_split_path_info ^(.+.php)(/.+)$;
        	include /etc/nginx/fastcgi_params;
        	fastcgi_pass 127.0.0.1:9000;
        	fastcgi_index index.php;
		fastcgi_connect_timeout 1000;
		fastcgi_send_timeout 1000;
		fastcgi_read_timeout 1000;
		fastcgi_buffer_size 256k;
		fastcgi_buffers 4 256k;
		fastcgi_busy_buffers_size 256k;
		fastcgi_temp_file_write_size 256k;
		fastcgi_intercept_errors on;
        	fastcgi_param SCRIPT_FILENAME /home/subdomain.mydomain.com/public_html$fastcgi_script_name;
    	}
		
	location /nginx_status {
  		stub_status on;
  		access_log off;
		allow 127.0.0.1;
		deny all;
	}
	location /php_status {
		fastcgi_pass 127.0.0.1:9000;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME /home/subdomain.mydomain.com/public_html$fastcgi_script_name;
		include /etc/nginx/fastcgi_params;
		allow 127.0.0.1;
		deny all;
    	}
	location ~ /. {
		deny all;
	}
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }
       location = /robots.txt {
		allow all;
		log_not_found off;
		access_log off;
       }
	location ~* .(3gp|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|woff2|ttf|woff)$ {
	        gzip_static off;
		add_header Pragma public;
		add_header Cache-Control "public, must-revalidate, proxy-revalidate";
		access_log off;
		expires 30d;
		break;
        }

        #location ~* .(txt|js|css)$ {
	    #add_header Pragma public;
		#add_header Cache-Control "public, must-revalidate, proxy-revalidate";
		#access_log off;
		#expires 30d;
		#break;
        #}
		
		
		location ~* .(eot|otf|ttf|woff|woff2)$ {
			add_header Access-Control-Allow-Origin *;
		}
		
		# Solve email tracking mautic
		location ~ email/(.*).gif {
		try_files $uri /index.php?$args;
		}
		# Solve JS Loading 404 Error
		location ~ (.*).js {
		try_files $uri /index.php?$args;
		add_header Access-Control-Allow-Origin *;
		}
	
	}
```

---

<div class="post-metadata">

**Author:** ![arjon](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@arjon](https://forum.mautic.org/u/arjon)\
**Post date:** [October 27, 2017, 10:01am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/15 "2017-10-27T10:01:33Z")

</div>

@fususu what does this line have include /home/subdomain.mydomain.com/public\_html/\*.conf;

---

<div class="post-metadata">

**Author:** ![arjon](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@arjon](https://forum.mautic.org/u/arjon)\
**Post date:** [October 27, 2017, 10:18am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/16 "2017-10-27T10:18:31Z")

</div>

I get error 405 for /mtc/event and 404 for mtracking.gif

---

<div class="post-metadata">

**Author:** ![arjon](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@arjon](https://forum.mautic.org/u/arjon)\
**Post date:** [October 27, 2017, 10:21am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/17 "2017-10-27T10:21:00Z")

</div>

Fixed error 404 for mtracking.gif. Edited

` location ~ email/(.*).gif {
		try_files $uri /index.php?$args;
		}`  
to

` location ~ (.*).gif {
		try_files $uri /index.php?$args;
		}`

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [October 28, 2017, 8:40am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/18 "2017-10-28T08:40:39Z")

</div>

> [@26757:@arjon](#):
>
> @fususu what does this line have include /home/subdomain.mydomain.com/public\_html/\*.conf;

Some wordpress plugins may create custom nginx file in the public\_html folder, this line will include that custom conf file. Anyway, it’s not related to Mautic ^^!

–  
Nice to be here with you guys, let’s make a great community.  
My blog: [https://fususu.com/en/](https://fususu.com/en/) My fb: [Facebook](https://fb.com/fususuvn)

---

<div class="post-metadata">

**Author:** ![arjon](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@arjon](https://forum.mautic.org/u/arjon)\
**Post date:** [October 28, 2017, 2:02pm UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/19 "2017-10-28T14:02:40Z")

</div>

[quote=26769:@fususu]Some wordpress plugins may create custom nginx file in the public\_html folder, this line will include that custom conf file. Anyway, it’s not related to Mautic ^^!

–  
Nice to be here with you guys, let’s make a great community.  
My blog: [https://fususu.com/en/](https://fususu.com/en/) My fb: [https://fb.com/fususuvn[/quote]](https://fb.com/fususuvn%5B/quote%5D)

Why did you put “/home/subdomain.mydomain.com/public\_html” at PHP location?

---

<div class="post-metadata">

**Author:** ![fususu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fususu/32/215_2.png) [@fususu](https://forum.mautic.org/u/fususu)\
**Post date:** [October 30, 2017, 6:01am UTC](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477/20 "2017-10-30T06:01:49Z")

</div>

> [@26772:@arjon](#):
>
> Why did you put “/home/subdomain.mydomain.com/public\_html” at PHP location?

It’s related to some optimized configs for the VPS that was pre-installed before. I used the script here to setup VPS in 15 minutes with all things I need [Cài đặt và Quản lý server dễ dàng với HocVPS Script - Học VPS](https://hocvps.com/script/)

[Next page](https://forum.mautic.org/t/form-wont-show-via-javascrip-404-not-found/9477.md?page=2)
