Created
November 6, 2017 09:20
-
-
Save apiworks/892366b1db833efa0c39cdcf682012d6 to your computer and use it in GitHub Desktop.
Magento 1 NGINX config for MAMP Pro
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 80; | |
server_name sample.loc; | |
set $MAGE_ROOT /Users/darkogoles/Sites/sample.loc; | |
access_log /usr/local/etc/nginx/logs/sample_access.log; | |
error_log /usr/local/etc/nginx/logs/sample_error.log; | |
root $MAGE_ROOT; | |
index index.php; | |
autoindex off; | |
charset UTF-8; | |
error_page 404 403 = /errors/404.php; | |
#add_header "X-UA-Compatible" "IE=Edge"; | |
## 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; } | |
location /var/export/ { deny all; } | |
# deny htaccess files | |
location ~ /\. { | |
deny all; | |
access_log off; | |
log_not_found off; | |
} | |
location ~* \.(jpg|jpeg|png|gif|ico)$ { | |
expires 365d; | |
log_not_found off; | |
access_log off; | |
} | |
location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler | |
rewrite ^(.*.php)/ $1 last; | |
} | |
## rewrite anything else to index.php | |
location / { | |
index index.html index.php; | |
try_files $uri $uri/ /index.php?$query_string; | |
expires 30d; | |
rewrite /api/rest /api.php?type=rest; | |
} | |
# pass the PHP scripts to FPM socket | |
location ~ \.php$ { | |
fastcgi_pass unix:/Applications/MAMP/Library/logs/fastcgi/nginxFastCGI_php5.6.31.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
include /Applications/MAMP/conf/nginx/fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using Mamp Pro I've been searching for hours where the
fastcgi_params
is located, now I found it. Thank you very much!