Created
February 3, 2018 20:26
-
-
Save tinchodev/431b5ed2819cc3821707b59d0a91aa51 to your computer and use it in GitHub Desktop.
NGINX configuration file for Magento 1.x
This file contains hidden or 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 80; | |
server_name domain.tld www.domain.tld; | |
root /var/server/web/site; | |
location / { | |
index index.php index.html; | |
try_files $uri $uri/ @handler; | |
expires 30d; | |
} | |
## These locations would be hidden by .htaccess normally | |
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; } | |
## Disable .htaccess and other hidden files | |
location ~ /\. { | |
deny all; | |
access_log off; | |
log_not_found off; | |
} | |
location @handler { | |
rewrite / /index.php; | |
} | |
location ~ \.php/ { | |
rewrite ^(.*\.php)/ $1 last; | |
} | |
location ~ \.php$ { | |
if (!-e $request_filename) { | |
rewrite / /index.php last; | |
} | |
expires off; | |
fastcgi_pass unix:/run/php/php7.0-fpm.sock; | |
include snippets/fastcgi-php.conf; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment