nginx and robots.txt 404 error

Speed Total

Member
Mar 29, 2016
6
1
53
Sibiu
cPanel Access Level
Root Administrator
Hi all,

I have installed the nginx inEasyApache and enabled for some domain, but now I am getting an error.

404 for robots.txt and if i rename the file in rrobots.txt (with 2 r or other name) the new file can be accessed.

Any ideas?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,491
1,008
313
cPanel Access Level
Root Administrator
We did run into an issue last month where the favicon files were not being handled properly through nginx. If you are signed in to our ticket system you can see this article:


I'm wondering if something similar is happening here with the robots.txt files as well. Could you create a support ticket with our team so we can do some additional investigation on your machine?
 

SGM

Registered
Nov 22, 2008
3
0
51
I just bumped in the same issue. The problem is in /etc/nginx/conf.d/server-includes/cpanel-static-locations.conf file, which is included for every vhost. It's using specific location matches, so it never goes the default "location /" to proxy to apache, so it ends up looking for the files (both /favicon.ico and /robots.txt) in the default document root.

Quick and dirty fix - comment out the sections for both /favicon.ico and /robots.txt in /etc/nginx/conf.d/server-includes/cpanel-static-locations.conf.