server { listen 80; server_name localhost; root /var/www/html/; autoindex off; # Gzip-Komprimierung gzip on; gzip_min_length 1100; gzip_buffers 4 8k; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/javascript application/json; location / { index index.php; try_files $uri $uri/ @handler; expires 30d; } # .htaccess-Schutz ersetzen location ~ (/(app/|includes/|lib/|/pkginfo/|var/|report/config.xml)|/\.svn/|/.hta.+) { deny all; } # statische Dateien direkt ausliefern location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { access_log off; expires 30d; root /var/www/html/; } # / an den Magento-Frontcontroller weiterleiten location @handler { rewrite / /index.php; } # PHP an PHP-FPM weiterreichen 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; include /etc/nginx/fastcgi_params; } }