I cannot make nginx work with this module.
I have tried a lot of nginx codes online, but none worked.
I get always 404 not found.

I had
location = /robots.txt {
access_log off;
try_files /sites/$host/files/robots.txt $uri @drupal;
}

I have also tried
try_files $uri @drupal;

Neither work.

What is your proposed code for nginx?
thanks

Comments

dropbydrop’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

I have the same with dev from february.

dropbydrop’s picture

Title: nginx configuration » Robots.txt 404 with Nginx
Category: support » bug
Priority: Normal » Major

I tried so many things. I think finally that this is a bug

dropbydrop’s picture

Category: bug » support
Priority: Major » Normal
Status: Active » Closed (fixed)
        location = /robots.txt {
		allow all;
                log_not_found off;
                access_log off;
		try_files @drupal $uri;
        }

	location @drupal {
                rewrite ^/(.*)$ /index.php?q=$1;
        }
Andreas Radloff’s picture

Old issue but you need to revert the order of try_files @drupal $uri like so:

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
                try_files $uri @drupal;
        }

        location @drupal {
                rewrite ^/(.*)$ /index.php?q=$1;
        }