Created
September 9, 2011 10:59
-
-
Save mtrl/1205947 to your computer and use it in GitHub Desktop.
Magento nginx conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 81; | |
server_name | |
[www.example.com] | |
[example.com] | |
; | |
rewrite ^(.*) https://[www.example.com]$1 permanent; | |
} | |
server { | |
listen 443 ssl; | |
server_name | |
[example.com] | |
[www.example.com] | |
; | |
ssl_certificate ssl/[example.com].pem; | |
ssl_certificate_key ssl/[example.com].key; | |
keepalive_timeout 60; | |
root /var/www/[example.com]; | |
index index.html index.php; | |
expires 30d; | |
location / { | |
try_files $uri $uri/ @magento; | |
} | |
# disable dangerous locations | |
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 @magento { | |
rewrite / /index.php; | |
} | |
location ~ \.php/ { | |
rewrite ^(.*\.php)/ $1 last; | |
} | |
location ~ \.php$ { | |
if (!-e $request_filename) { | |
## Catch 404s that try_files misses | |
rewrite / /index.php last; | |
} | |
expires -1; | |
fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration | |
fastcgi_param MAGE_RUN_TYPE store; | |
include conf/php-cgi.conf; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment