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
9,903
1,541
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.
 

Benjamin Biswas

Registered
Nov 10, 2018
3
1
3
Dhaka
cPanel Access Level
Root Administrator
We have resolve this in the latest version, with some discussion on that here: In Progress - EA-9789 - NGINX Anacron Logrotate Error
At which version you fixed the issue? I am using cPanel & WHM v102.0.11 & still getting same 404. I mean robots.txt not loading for any website & show 404 until omit the code as like my attachment from this file: /etc/nginx/conf.d/server-includes/cpanel-static-locations.conf
 

Attachments

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
9,903
1,541
313
cPanel Access Level
Root Administrator
Packages under EasyApache don't get assigned to a specific cPanel version as they are independent of the major release tier. Every package since ea-nginx-1.21.0-3.3.1 would have this fix applied. I checked my personal server just now and that is running ea-nginx-1.21.6-12.12.1