Skip to content

Instantly share code, notes, and snippets.

@olivierobert
Created September 6, 2013 02:20
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 olivierobert/6458770 to your computer and use it in GitHub Desktop.
Save olivierobert/6458770 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name site.com;
root /var/www/magento;
fastcgi_read_timeout 1200;
fastcgi_connect_timeout 1200;
access_log /var/log/nginx/magento.log main;
error_log /var/log/nginx/magento.log;
location / {
index index.php index.html index.htm;
try_files $uri $uri/ @handler;
# expires 30d;
}
location /media/js/ {
gzip on;
gzip_min_length 1000;
gzip_disable "MSIE [1-6]\.";
expires 5d;
access_log off;
}
location /media/css/ {
gzip on;
gzip_min_length 1000;
gzip_disable "MSIE [1-6]\.";
expires 5d;
access_log off;
}
location /media/catalog/ {
access_log off;
}
location /js/ {
access_log off;
}
location /skin/ {
access_log off;
}
location /images/ {
access_log off;
}
location /app/ { deny all; }
location /includes/ { deny all; }
location /lib/ { deny all; }
location /media/downloadable/ { deny all; }
location /pkginfo/ { deny all; }
location /report/config.xml { deny all; }
location /var/ { deny all; }
location ~ /\.ht {
deny all;
}
location @handler {
rewrite / /index.php;
}
location ~ .php/ {
rewrite ^(.*.php)/ $1 last;
}
location ~ \.php$ {
gzip on;
gzip_min_length 1000;
gzip_disable "MSIE [1-6]\.";
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/magento$fastcgi_script_name;
include fastcgi_params;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment