WebFaction
Community site: login faq

Why doesn't this work...

location /robots.txt {
    alias /home/myuser/webapps/nginx/apps/the_app/webroot/robots.txt;
}

...when this works?

location /channel.html {
    alias /home/myuser/webapps/nginx/apps/the_app/templates/channel.html;
}

I can't figure it out. Does nginx handle robots.txt differently for some reason?

asked 01 Feb '12, 12:55

damd
191712
accept rate: 0%


That configuration should work. Are you placing it within a server context? And are there any permissions on the file or the parent directories that would stop the reading of that file?

permanent link

answered 01 Feb '12, 17:30

johns
5.4k412
accept rate: 23%

Yes, I'm placing it in server context. I have virtually the exact same configuration for favicon.ico. The permissions of robots.txt (and the parent directories) look fine to me.

(02 Feb '12, 13:20) damd

Based on the above info alone I can not determine why it would fail, many examples online including ones found in the official nginx docs show exactly that. We would have to see the whole server stack in real time to troubleshoot. You may submit a support ticket if you would like us to take a look.

(02 Feb '12, 17:24) johns

@IMitwe what sort of error do you see when you try to access robots.txt?

(06 Nov '14, 22:50) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186

question asked: 01 Feb '12, 12:55

question was seen: 5,691 times

last updated: 06 Nov '14, 22:50

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM