This is my host file:
server {
root /path/to/root/domain/html;
index index.php;
server_name servername.de;
location / {
index index.html index.php;
try_files $uri $uri/ @handler;
expires 30d;
}
location ^~ /(app|includes|lib|media/downloadable|pkginfo|report/config.xml|var)/ { internal; }
location /var/export/ { internal; }
location /. { return 404; }
location @handler { rewrite / /index.php; }
location ~* .php/ { rewrite ^(.*.php)/ $1 last; }
location ~* .php$ {
if (!-e $request_filename) { rewrite / /index.php last; }
expires off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params;
}
}
I have changed “Use Web Server Rewrites” to “Yes” from Magento Admin panel to make the Urls SEO friendly(without index.php). And i have cleared the magento cache from admin panel after restarting the nginx.
Can anyone help me to find out that the nginx configured correctly or why am getting this error.
3
Answers
Myself fixed the issue. I was using Plesk and there was an option to add Additional nginx directives. I removed the host file “/etc/nginx/conf.d/DOMAIN.conf”(Individual sites section in https://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento. Remember to configure “/etc/nginx/nginx.conf” properly.) and added the below code in my "Additional nginx directives" admin area in Plesk.
You may try this configuration:
Also, for this and related issues, you may check the official Magento guides: https://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento
This line made a difference for me.