# NGINX # FILE: /usr/local/etc/nginx/conf.d/magento.conf # Forward Fooman Speedster requests to minify controller location /minify/ { rewrite ^/minify/([0-9]+)(/.*\.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last; } # Show correct errors caused when a store owner enables built-in minification location /skin/m/ { rewrite ^/skin/m/([0-9]+)(/.*.(js|css))$ /lib/minify/m.php?f=$2&d=$1 last; } # Deny access to files the public doesn't need location ^~ /(app|config|includes|lib|media/customer|media/downloadable|pkginfo|report/config.xml|shell|var)/ { internal; } # Attempt to serve the request by trying direct file, directory, Magento front controller location / { try_files $uri $uri/ /index.php?$args; } # The downloader has its own index.php that needs to be used location ~* ^(/downloader)(.*) { try_files $uri $uri/ /downloader/index.php$1; } # REST API endpoint location /api { rewrite ^/api/rest /api.php?type=rest last; rewrite ^/api/v2_soap /api.php?type=v2_soap last; rewrite ^/api/soap /api.php?type=soap last; } # Pass PHP scripts to PHP-FPM daemon # Check: http://wiki.nginx.org/Pitfalls location ~* \.php$ { # filter out problem conditions location ~ \..*/.*\.php$ { return 404; } # bring in parameters include conf.d/fastcgi.conf; fastcgi_param MAGE_IS_DEVELOPER_MODE true; fastcgi_param MAGE_RUN_CODE default; fastcgi_param MAGE_RUN_TYPE store; # send requests to Upstream, but blacklist media location from fastcgi if ($uri !~ "^/(media)/") { fastcgi_pass phpfpm; } }