While migrating a site from another server, some strange problem occured. I use the default configuration for all my drupal sites, but this one doesnt seem to work. Some image files cause an internal server error - rewrite or internal redirection cycle. The site does not have a domain, yet, so I am testing with the server ip, which should not be a problem. When using this configuration for some default drupal installation, everything works fine. I also use memcached for static file caching, you can see that. As already mentioned, all of this should work properly.
This is my configuration:
server {
server_name SERVERIP;
root /var/www/;
listen 80;
listen [::]:80;
index index.php;
access_log /var/log/nginx/SERVERIP.access.log;
error_log /var/log/nginx/SERVERIP.error.log;
if (-f $request_filename) {
break;
}
# memcached
location ~* \.(jpg|png|gif|js)$ {
access_log off;
expires max;
set $memcached_key $uri;
memcached_pass memcached;
error_page 404 = @domain;
}
location / {
try_files $uri $uri/ @domain;
}
location ~* ^.+.(htm|html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$ {
access_log off;
expires max;
root /var/www/;
}
location @domain {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_NAME /index.php;
}
location ~ \.php$ {
try_files $uri $uri/ @domain;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}
I would be very glad if anyone could help me out. Thanks in advance.
regards