diff --git a/README.md b/README.md
index c68a29d..dae3ac7 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,7 @@
* PHP backup server
* WordPress security essentials
* Drupal security essentials
+* Magento security essentials
### Routing
* `index`
diff --git a/public/assets/img/brands/magento.svg b/public/assets/img/brands/magento.svg
new file mode 100644
index 0000000..fe656cb
--- /dev/null
+++ b/public/assets/img/brands/magento.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/public/assets/js/app.js b/public/assets/js/app.js
index 9c3b847..68887f8 100644
--- a/public/assets/js/app.js
+++ b/public/assets/js/app.js
@@ -52,6 +52,7 @@
php_server_backup: '',
wordpress: false,
drupal: false,
+ magento: false,
file_structure: 'modularized',
symlink: true,
@@ -379,6 +380,7 @@
$scope.data.php = $scope.defaultData.php;
$scope.data.wordpress = $scope.defaultData.wordpress;
$scope.data.drupal = $scope.defaultData.drupal;
+ $scope.data.magento = $scope.defaultData.magento;
$scope.data.proxy = $scope.defaultData.proxy;
$scope.data.index = $scope.defaultData.index;
$scope.data.fallback_html = $scope.defaultData.fallback_html;
@@ -402,6 +404,9 @@
case 'drupal':
$scope.data.drupal = true;
break;
+ case 'magento':
+ $scope.data.magento = true;
+ break;
case 'nodejs':
$scope.data.php = false;
$scope.data.proxy = true;
@@ -538,6 +543,10 @@
return $scope.isPHP() && $scope.data.drupal;
};
+ $scope.isMagento = function() {
+ return $scope.isPHP() && $scope.data.magento;
+ };
+
$scope.isCSP = function() {
return !!$scope.data.content_security_policy;
};
diff --git a/public/index.html b/public/index.html
index 5ec8e63..c3c6a99 100644
--- a/public/index.html
+++ b/public/index.html
@@ -8,9 +8,9 @@
nginxconfig.io
-
+
-
+
@@ -29,6 +29,7 @@
+
+
+ /etc/nginx/nginxconfig.io/magento.conf
+
+ Copied!
+
+
diff --git a/public/templates/conf/nginxconfig.io/magento.conf.html b/public/templates/conf/nginxconfig.io/magento.conf.html
new file mode 100644
index 0000000..59c7590
--- /dev/null
+++ b/public/templates/conf/nginxconfig.io/magento.conf.html
@@ -0,0 +1,82 @@
+# Magento: setup
+location ^~ /setup {
+ root $base;
+
+ # allow index.php
+ location ~ ^/setup/index.php {
+ include nginxconfig.io/php_fastcgi.conf;
+ }
+
+ # deny everything except pub
+ location ~ ^/setup/(?!pub/). {
+ deny all;
+ }
+}
+
+# Magento: update
+location ^~ /update {
+ root $base;
+
+ # allow index.php
+ location ~ ^/update/index.php {
+ include nginxconfig.io/php_fastcgi.conf;
+ }
+
+ # deny everything except pub
+ location ~ ^/update/(?!pub/). {
+ deny all;
+ }
+}
+
+# Magento: media files
+location ^~ /media/ {
+ try_files $uri $uri/ /get.php?$args;
+
+ location ~* \.(?:ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
+ expires +1y;
+ add_header Cache-Control "public";
+ try_files $uri $uri/ /get.php?$args;
+ }
+
+ location ~* \.(?:zip|gz|gzip|bz2|csv|xml)$ {
+ expires off;
+ add_header Cache-Control "no-store";
+ try_files $uri $uri/ /get.php?$args;
+ }
+
+ location ~ ^/media/theme_customization/.*\.xml {
+ deny all;
+ }
+
+ location ~ ^/media/(?:customer|downloadable|import)/ {
+ deny all;
+ }
+}
+
+# Magento: static route
+location @magento_static {
+ rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last;
+}
+
+# Magento: static files
+location ^~ /static/ {
+ expires max;
+ try_files $uri $uri/ @magento_static;
+
+ location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$ {
+ expires +1y;
+ add_header Cache-Control "public";
+ try_files $uri $uri/ @magento_static;
+ }
+
+ location ~* \.(zip|gz|gzip|bz2|csv|xml)$ {
+ expires off;
+ add_header Cache-Control "no-store";
+ try_files $uri $uri/ @magento_static;
+ }
+}
+
+# Magento: deny cron
+location ~ cron\.php {
+ deny all;
+}
diff --git a/public/templates/conf/sites-available/example.com.conf.html b/public/templates/conf/sites-available/example.com.conf.html
index bf3952d..b4e9b65 100644
--- a/public/templates/conf/sites-available/example.com.conf.html
+++ b/public/templates/conf/sites-available/example.com.conf.html
@@ -98,6 +98,9 @@ server {
include nginxconfig.io/drupal.conf;
+ include nginxconfig.io/magento.conf;
@@ -110,7 +113,11 @@ server {
-
+
+
+
}