Skip to content

Instantly share code, notes, and snippets.

@ryaan-anthony
Created November 22, 2013 21:30
Show Gist options
  • Select an option

  • Save ryaan-anthony/7607232 to your computer and use it in GitHub Desktop.

Select an option

Save ryaan-anthony/7607232 to your computer and use it in GitHub Desktop.
server {
listen 80;
#listen 443 ssl;
#ssl_certificate tls/magento_local.pem;
#ssl_certificate_key tls/magento_local.key;
#ssl_session_timeout 7m;
## Specify your SSL options here
#ssl_protocols SSLv2 SSLv3 TLSv1;
#ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
#ssl_prefer_server_ciphers on;
access_log /var/log/nginx/magento.local-access.log;
error_log /var/log/nginx/magento.local-error.log;
server_name www.3460229.pubip.peer1.net 3460229.pubip.peer1.net;
root /var/www/magento;
include conf/magento_rewrites.conf;
include conf/magento_security.conf;
# PHP handler
location ~ \.php {
## Catch 404s that try_files miss
if (!-e $request_filename) { rewrite / /index.php last; }
## Store code is defined in administration > Configuration > Manage Stores
fastcgi_param MAGE_RUN_CODE default;
fastcgi_param MAGE_RUN_TYPE store;
# By default, only handle fcgi without caching
include conf/magento_fcgi.conf;
}
# 404s are handled by front controller
location @magefc {
rewrite / /index.php;
}
# Last path match hands to magento or sets global cache-control
location / {
## Maintenance page overrides front controller
index index.html index.php;
try_files $uri $uri/ @magefc;
expires 24h;
}
# Enable caching font files by default
location ~ \.(ttf|woff|eot) {
add_header Cache-Control public;
add_header Access-Control-Allow-Origin *;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment