Skip to content

Instantly share code, notes, and snippets.

@zrod
Created February 18, 2012 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zrod/1861309 to your computer and use it in GitHub Desktop.
Save zrod/1861309 to your computer and use it in GitHub Desktop.
Magento - nginx config
# Magento
server {
listen 80;
server_name store;
error_log /var/log/nginx/store.error_log;
root /home/rod/www/magento;
index index.php;
location / {
try_files $uri $uri/ /index.php?$uri&$args;
}
location ~* "^.+\.(jpe?g|gif|css|png|js|ico|pdf|zip|tar|t?gz|mp3|wav|swf)$" {
expires max;
add_header Cache-Control public;
}
location ~* ^(/downloader|/js|/404|/report)(.*) {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$1/index.php$1;
fastcgi_read_timeout 600;
fastcgi_pass 127.0.0.1:9000;
}
location ~* \.php {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
fastcgi_pass 127.0.0.1:9000;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment