├── LICENSE ├── README.md └── configs ├── 1c-bitrix.conf ├── asgard-cms.conf ├── bolt-cms.conf ├── cms-made-simple.conf ├── codeigniter.conf ├── concerte5.conf ├── craftcms-2.conf ├── data-life-engine.conf ├── drupal-7-8.conf ├── fuelphp.conf ├── hostcms.conf ├── impresspages.conf ├── instantcms.conf ├── ipb3.conf ├── joomla-2-3.conf ├── kodicms.conf ├── kohana.conf ├── laravel.conf ├── livestreet.conf ├── maxsite-cms.conf ├── mediawiki.conf ├── modx-revolution.conf ├── octobercms.conf ├── opencart-15.conf ├── osticket.conf ├── phalcon.conf ├── phpbb3.conf ├── prestashop-1-6.conf ├── prestashop.conf ├── processwire-2.conf ├── subrion.conf ├── symfony.conf ├── umi-cms.conf ├── webasyst.conf ├── wordpress-4-supercache.conf ├── wordpress-4.conf ├── yii-advanced.conf ├── yii-basic.conf ├── zencart-15.conf └── zend-framework.conf /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Elasticweb.org 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nginx Configs 2 | 3 | Collection of Nginx configs for most popular CMS/CMF/Frameworks based on PHP. 4 | 5 | ## Table of Contents 6 | 7 | - [Asgard CMS](configs/asgard-cms.conf) 8 | - [Bolt CMS](configs/bolt-cms.conf) 9 | - [CMS Made Simple](configs/cms-made-simple.conf) 10 | - [Codeigniter](configs/codeigniter.conf) 11 | - [Concerte5](configs/concerte5.conf) 12 | - [CraftCMS 2](configs/craftcms-2.conf) 13 | - [Data Life Engine](configs/data-life-engine.conf) 14 | - [Drupal 7, 8](configs/drupal-7-8.conf) 15 | - [FuelPHP](configs/fuelphp.conf) 16 | - [HostCMS](configs/hostcms.conf) 17 | - [ImpressPages](configs/impresspages.conf) 18 | - [InstantCMS](configs/instantcms.conf) 19 | - [Invision Power Board 3](configs/ipb3.conf) 20 | - [Joomla 2, 3](configs/joomla-2-3.conf) 21 | - [KodiCMS](configs/kodicms.conf) 22 | - [Kohana](configs/kohana.conf) 23 | - [Laravel](configs/laravel.conf) 24 | - [LiveStreet](configs/livestreet.conf) 25 | - [MaxSite CMS](configs/maxsite-cms.conf) 26 | - [MediaWiki](configs/mediawiki.conf) 27 | - [MODx Revolution](configs/modx-revolution.conf) 28 | - [Octobercms](configs/octobercms.conf) 29 | - [OpenCart 1.5](configs/opencart-15.conf) 30 | - [OsTicket](configs/osticket.conf) 31 | - [Phalcon](configs/phalcon.conf) 32 | - [phpBB3](configs/phpbb3.conf) 33 | - [ProcessWire 2](configs/processwire-2.conf) 34 | - [Subrion CMS](configs/subrion.conf) 35 | - [Symfony](configs/symfony.conf) 36 | - [UMI.CMS](configs/umi-cms.conf) 37 | - [WebAsyst](configs/webasyst.conf) 38 | - [Wordpress 4](configs/wordpress-4.conf) 39 | - [Wordpress 4 + SuperCache](configs/wordpress-4-supercache.conf) 40 | - [Yii Advanced](configs/yii-advanced.conf) 41 | - [Yii Basic](configs/yii-basic.conf) 42 | - [ZenCart 1.5](configs/zencart-15.conf) 43 | - [Zend Framework](configs/zend-framework.conf) 44 | - [1C Bitrix](configs/1c-bitrix.conf) 45 | -------------------------------------------------------------------------------- /configs/1c-bitrix.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ @bitrix; 5 | } 6 | 7 | location @bitrix { 8 | include fastcgi_params; 9 | fastcgi_pass unix:/var/run/php5-example.com.sock; 10 | fastcgi_intercept_errors on; 11 | fastcgi_param SCRIPT_FILENAME $document_root/bitrix/urlrewrite.php; 12 | } 13 | 14 | location ~ \.php$ { 15 | try_files $uri @bitrix; 16 | include fastcgi_params; 17 | fastcgi_pass unix:/var/run/php5-example.com.sock; 18 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 19 | } 20 | 21 | location ^~ /bitrix/admin/ { 22 | try_files $uri @bitrixadm; 23 | fastcgi_pass unix:/var/run/php5-example.com.sock; 24 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 25 | include fastcgi_params; 26 | } 27 | 28 | location @bitrixadm { 29 | fastcgi_pass unix:/var/run/php5-example.com.sock; 30 | include fastcgi_params; 31 | fastcgi_param SCRIPT_FILENAME $document_root/bitrix/admin/404.php; 32 | } 33 | 34 | location = /favicon.ico { 35 | access_log off; 36 | } 37 | 38 | location = /robots.txt { 39 | allow all; 40 | access_log off; 41 | } 42 | 43 | location ~ (/bitrix/modules|/upload/support/not_image|/bitrix/php_interface) { 44 | deny all; 45 | } 46 | 47 | location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ { 48 | access_log off; 49 | expires max; 50 | } 51 | 52 | location ~ /\. { 53 | deny all; 54 | } 55 | -------------------------------------------------------------------------------- /configs/asgard-cms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/public; 2 | 3 | location ~ /\.svn { 4 | deny all; 5 | } 6 | 7 | location ~ /\.git { 8 | deny all; 9 | } 10 | 11 | location ~ /\.hg { 12 | deny all; 13 | } 14 | 15 | location = /favicon.ico { 16 | log_not_found off; 17 | access_log off; 18 | } 19 | 20 | location = /robots.txt { 21 | allow all; 22 | log_not_found off; 23 | access_log off; 24 | } 25 | 26 | location ~ (^|/)\. { 27 | return 403; 28 | } 29 | 30 | location / { 31 | try_files $uri $uri/ /index.php?$query_string; 32 | } 33 | 34 | location /vendor/ { 35 | location ~ .*\.(js|css|png|jpg|jpeg|gif|ico)?$ { 36 | root /home/u1/domains/example.com; 37 | } 38 | } 39 | 40 | location ~ \.php$ { 41 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 42 | include fastcgi_params; 43 | fastcgi_param SCRIPT_FILENAME $request_filename; 44 | fastcgi_intercept_errors on; 45 | fastcgi_pass unix:/var/run/php5-example.com.sock; 46 | } 47 | -------------------------------------------------------------------------------- /configs/bolt-cms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?$query_string; 5 | } 6 | 7 | location ~* /thumbs/(.*)$ { 8 | try_files $uri $uri/ /app/classes/timthumb.php?$query_string; 9 | } 10 | 11 | location ~* /bolt/(.*)$ { 12 | try_files $uri $uri/ /index.php?$query_string; 13 | } 14 | 15 | location ~* /async/(.*)$ { 16 | try_files $uri $uri/ /index.php?$query_string; 17 | } 18 | 19 | location /app/classes/upload { 20 | try_files $uri $uri/ /app/classes/upload/index.php?$query_string; 21 | } 22 | 23 | location ~ \.php$ { 24 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 25 | include fastcgi_params; 26 | fastcgi_param SCRIPT_FILENAME $request_filename; 27 | fastcgi_intercept_errors on; 28 | fastcgi_pass unix:/var/run/php5-example.com.sock; 29 | } 30 | 31 | location ~ /\. { 32 | deny all; 33 | } 34 | 35 | location /app { 36 | deny all; 37 | } 38 | 39 | location ~ cache/ { 40 | return 403; 41 | } 42 | 43 | location ~ /vendor { 44 | deny all; 45 | } 46 | 47 | location ~ \.db$ { 48 | deny all; 49 | } 50 | 51 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 52 | expires 7d; 53 | } 54 | -------------------------------------------------------------------------------- /configs/cms-made-simple.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location ~ /\. { 4 | deny all; 5 | } 6 | 7 | location / { 8 | try_files $uri $uri/ @cmsmadesimple; 9 | } 10 | 11 | location @cmsmadesimple { 12 | rewrite ^\/?(.*)\.html$ /index.php?page=$1 last; 13 | rewrite ^\/?(.*)$ /index.php?page=$1 last; 14 | break; 15 | } 16 | 17 | location ~ \.php$ { 18 | include fastcgi_params; 19 | fastcgi_pass unix:/var/run/php5-example.com.sock; 20 | fastcgi_index index.php; 21 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 22 | } 23 | -------------------------------------------------------------------------------- /configs/codeigniter.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?$query_string; 5 | } 6 | 7 | location ~* \.php$ { 8 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 9 | include fastcgi_params; 10 | fastcgi_param SCRIPT_FILENAME $request_filename; 11 | fastcgi_intercept_errors on; 12 | fastcgi_pass unix:/var/run/php5-example.com.sock; 13 | } 14 | 15 | location ~ /\.svn { 16 | deny all; 17 | } 18 | 19 | location ~ /\.git { 20 | deny all; 21 | } 22 | 23 | location ~ /\.hg { 24 | deny all; 25 | } 26 | 27 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 28 | expires 7d; 29 | } 30 | -------------------------------------------------------------------------------- /configs/concerte5.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php$request_uri /index.php; 5 | } 6 | 7 | location = /favicon.ico { 8 | log_not_found off; 9 | access_log off; 10 | } 11 | 12 | location = /robots.txt { 13 | allow all; 14 | log_not_found off; 15 | access_log off; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 20 | include fastcgi_params; 21 | fastcgi_param SCRIPT_FILENAME $request_filename; 22 | fastcgi_intercept_errors on; 23 | fastcgi_pass unix:/var/run/php5-example.com.sock; 24 | try_files $uri =404; 25 | } 26 | 27 | location ~ /\. { 28 | deny all; 29 | access_log off; 30 | log_not_found off; 31 | } 32 | 33 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 34 | expires 7d; 35 | } 36 | -------------------------------------------------------------------------------- /configs/craftcms-2.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/public; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?p=$1; 5 | } 6 | 7 | location ~ \.php$ { 8 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 9 | include fastcgi_params; 10 | fastcgi_param SCRIPT_FILENAME $request_filename; 11 | fastcgi_intercept_errors on; 12 | fastcgi_pass unix:/var/run/php5-example.com.sock; 13 | } 14 | 15 | location ~ /\. { 16 | deny all; 17 | } 18 | 19 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 20 | expires 7d; 21 | } 22 | -------------------------------------------------------------------------------- /configs/data-life-engine.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | rewrite ^/page/(.*)$ /index.php?cstart=$1; 5 | 6 | rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/page,([0-9]+),([0-9]+),(.*).html*$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6; 7 | rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/page,([0-9]+),(.*).html*$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5; 8 | rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/print:page,([0-9]+),(.*).html*$ /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5; 9 | rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/(.*).html*$ /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4; 10 | 11 | rewrite ^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)$ /index.php?newsid=$4&news_page=$2&cstart=$3; 12 | rewrite ^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)$ /index.php?newsid=$3&news_page=$2; 13 | rewrite ^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)$ /engine/print.php?news_page=$2&newsid=$3; 14 | rewrite ^/([^.]+)/([0-9]+)-(.*).html(/?)$ /index.php?newsid=$2; 15 | 16 | rewrite ^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$3&news_page=$1&cstart=$2; 17 | rewrite ^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$2&news_page=$1; 18 | rewrite ^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ /engine/print.php?news_page=$1&newsid=$2; 19 | rewrite ^/([0-9]+)-(.*).html(/?)+$ /index.php?newsid=$1; 20 | 21 | rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)/page/([0-9]+)(.*)$ /index.php?year=$1&month=$2&day=$3&cstart=$4; 22 | rewrite ^/([0-9]+)/([0-9]+)/([0-9]+)(.*)$ /index.php?year=$1&month=$2&day=$3; 23 | 24 | rewrite ^/([0-9]+)/([0-9]+)/page/([0-9]+)(.*)$ /index.php?year=$1&month=$2&cstart=$3; 25 | rewrite ^/([0-9]+)/([0-9]+)(.*)$ /index.php?year=$1&month=$2; 26 | 27 | rewrite ^/([0-9]+)/page/([0-9]+)(.*)$ /index.php?year=$1&cstart=$2; 28 | rewrite ^/([0-9]+)(.*)$ /index.php?year=$1; 29 | 30 | rewrite ^/catalog/([^/]*)/page/([0-9]+)(.*)$ /index.php?catalog=$1&cstart=$2; 31 | rewrite ^/catalog/([^/]*)(.*)$ /index.php?catalog=$1; 32 | 33 | rewrite ^/newposts/page/([0-9]+)(.*)$ /index.php?subaction=newposts&cstart=$1; 34 | rewrite ^/newposts(.*)$ /index.php?subaction=newposts; 35 | 36 | rewrite ^/static/(.*).html(.*)$ /index.php?do=static&page=$1; 37 | 38 | rewrite ^/user/([^/]*)/news/page/([0-9]+)(.*)$ /index.php?subaction=allnews&user=$1&cstart=$2; 39 | rewrite ^/user/([^/]*)/news(.*)$ /index.php?subaction=allnews&user=$1; 40 | rewrite ^/user/([^/]*)(.*)$ /index.php?subaction=userinfo&user=$1; 41 | rewrite ^/favorites /index.php?do=favorites; 42 | rewrite ^/favorites/page/(.*)$ /index.php?do=favorites&cstart=$1; 43 | rewrite ^/statistics.html$ /index.php?do=stats; 44 | rewrite ^/addnews.html(.*)$ /index.php?do=addnews; 45 | rewrite ^/rss.xml$ /engine/rss.php; 46 | rewrite ^/sitemap.xml$ uploads/sitemap.xml; 47 | 48 | if (!-d $request_filename) { 49 | rewrite ^/([^.]+)/page/([0-9]+)(.*)$ /index.php?do=cat&category=$1&cstart=$2; 50 | rewrite ^/([^.]+)/*$ /index.php?do=cat&category=$1; 51 | } 52 | 53 | if (!-f $request_filename) { 54 | rewrite ^/([^<]+)/rss.xml$ /engine/rss.php?do=cat&category=$1; 55 | rewrite ^/page,([0-9]+),([^/]+).html$ /index.php?do=static&page=$2&news_page=$1; 56 | rewrite ^/([^/]+).html$ /index.php?do=static&page=$1; 57 | } 58 | } 59 | 60 | location /xfsearch { 61 | rewrite ^/xfsearch/([^/]*)/*$ /index.php?do=xfsearch&xf=$1; 62 | rewrite ^/xfsearch/([^/]*)/page/([0-9]+)/*$ /index.php?do=xfsearch&xf=$1&cstart=$2; 63 | } 64 | 65 | location ~ /\.svn { 66 | deny all; 67 | } 68 | 69 | location ~ /\.git { 70 | deny all; 71 | } 72 | 73 | location ~ /\.hg { 74 | deny all; 75 | } 76 | 77 | location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { 78 | try_files $uri =404; 79 | } 80 | 81 | location ~* (engine/cache) { 82 | deny all; 83 | } 84 | 85 | location ~ \.php$ { 86 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 87 | include fastcgi_params; 88 | fastcgi_param SCRIPT_FILENAME $request_filename; 89 | fastcgi_intercept_errors on; 90 | fastcgi_pass unix:/var/run/php5-example.com.sock; 91 | } 92 | -------------------------------------------------------------------------------- /configs/drupal-7-8.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location = /rss.xml { 4 | rewrite ^ /index.php?q=rss.xml; 5 | } 6 | 7 | location = /sitemap.xml { 8 | try_files $uri /index.php?q=sitemap.xml; 9 | } 10 | 11 | location / { 12 | location ^~ /system/files/ { 13 | fastcgi_pass unix:/var/run/php5-example.com.sock; 14 | log_not_found off; 15 | } 16 | 17 | location ^~ /sites/default/files/private/ { 18 | internal; 19 | } 20 | 21 | location ^~ /system/files_force/ { 22 | fastcgi_pass unix:/var/run/php5-example.com.sock; 23 | log_not_found off; 24 | } 25 | 26 | location ~* /imagecache/ { 27 | access_log off; 28 | expires 30d; 29 | try_files $uri @drupal; 30 | } 31 | 32 | location ~* /files/styles/ { 33 | access_log off; 34 | expires 30d; 35 | try_files $uri @drupal; 36 | } 37 | 38 | location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|svg)$ { 39 | access_log off; 40 | expires 30d; 41 | tcp_nodelay off; 42 | } 43 | 44 | location ~* ^.+\.(?:pdf|pptx?)$ { 45 | expires 30d; 46 | tcp_nodelay off; 47 | } 48 | 49 | location ^~ /help/ { 50 | location ~* ^/help/[^/]*/README\.txt$ { 51 | fastcgi_pass unix:/var/run/php5-example.com.sock; 52 | } 53 | } 54 | 55 | location ~* ^(?:.+\.(?:htaccess|make|engine|inc|info|install|module|profile|po|pot|sh|.*sql|test|theme|tpl(?:\.php)?|xtmpl)|code-style\.pl|/Entries.*|/Repository|/Root|/Tag|/Template)$ { 56 | return 404; 57 | } 58 | 59 | try_files $uri $uri/ @cache; 60 | } 61 | 62 | location @cache { 63 | if ($query_string ~ ".+") { 64 | return 405; 65 | } 66 | 67 | if ($http_cookie ~ "DRUPAL_UID" ) { 68 | return 405; 69 | } 70 | 71 | if ($request_method !~ ^(GET|HEAD)$ ) { 72 | return 405; 73 | } 74 | 75 | error_page 405 = @drupal; 76 | expires 12h; 77 | add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"; 78 | try_files /cache/normal/$host/${uri}_.html /cache/perm/$host/${uri}_.css /cache/perm/$host/${uri}_.js /cache/$host/0$uri.html /cache/$host/0${uri}/index.html @drupal; 79 | } 80 | 81 | location @drupal { 82 | rewrite ^ /index.php; 83 | } 84 | 85 | location @drupal-no-args { 86 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 87 | include fastcgi_params; 88 | fastcgi_intercept_errors on; 89 | fastcgi_pass unix:/var/run/php5-example.com.sock; 90 | } 91 | 92 | location ~ /\. { 93 | deny all; 94 | } 95 | 96 | location @empty { 97 | expires 30d; 98 | } 99 | 100 | location = /boost_stats.php { 101 | fastcgi_pass unix:/var/run/php5-example.com.sock; 102 | } 103 | 104 | location ~ \.php$ { 105 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 106 | include fastcgi_params; 107 | fastcgi_param SCRIPT_FILENAME $request_filename; 108 | fastcgi_intercept_errors on; 109 | fastcgi_pass unix:/var/run/php5-example.com.sock; 110 | } 111 | -------------------------------------------------------------------------------- /configs/fuelphp.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ @fuel; 5 | expires 30d; 6 | } 7 | 8 | location @fuel { 9 | rewrite ^ /index.php?/$request_uri; 10 | } 11 | 12 | location ~* ^/(modules|application|system) { 13 | return 403; 14 | } 15 | 16 | location ~ \.php$ { 17 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 18 | include fastcgi_params; 19 | fastcgi_param SCRIPT_FILENAME $request_filename; 20 | fastcgi_intercept_errors on; 21 | fastcgi_pass unix:/var/run/php5-example.com.sock; 22 | } 23 | 24 | location ~ /\.svn { 25 | deny all; 26 | } 27 | 28 | location ~ /\.git { 29 | deny all; 30 | } 31 | 32 | location ~ /\.hg { 33 | deny all; 34 | } 35 | 36 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 37 | expires 7d; 38 | } 39 | -------------------------------------------------------------------------------- /configs/hostcms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ @hostcms; 5 | } 6 | 7 | location @hostcms { 8 | rewrite ^(.*)$ /index.php; 9 | } 10 | 11 | location ~ /\. { 12 | deny all; 13 | } 14 | 15 | location /cron { 16 | deny all; 17 | } 18 | 19 | location ~ /hostcmsfiles/\.(php|php3|php4|php5|php6|phps|phtml)$ { 20 | deny all; 21 | } 22 | 23 | location ~ /templates/\.(htm|html|php|php3|php4|php5|php6|phps|phtml)$ { 24 | deny all; 25 | } 26 | 27 | location ~ /upload/\.(php|php3|php4|php5|php6|phps|phtml)$ { 28 | deny all; 29 | } 30 | 31 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 32 | expires 7d; 33 | } 34 | 35 | location ~ \.php$ { 36 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 37 | include fastcgi_params; 38 | fastcgi_param SCRIPT_FILENAME $request_filename; 39 | fastcgi_intercept_errors on; 40 | fastcgi_pass unix:/var/run/php5-example.com.sock; 41 | } 42 | -------------------------------------------------------------------------------- /configs/impresspages.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | #restrict access to the secure folder 4 | location /file/secure/ { 5 | deny all; 6 | } 7 | 8 | #restrict access to config.php file 9 | location ~ ^/config.php { 10 | deny all; 11 | } 12 | 13 | #restrict access to PHP files in upload directory 14 | location ~ ^/file/(.)*\.php { 15 | deny all; 16 | } 17 | 18 | #restrict access to ImpressPages bootstrap directory 19 | location ~ ^/Ip/script/ { 20 | deny all; 21 | } 22 | 23 | #route all requests to index.php 24 | location / { 25 | index index.php; 26 | try_files $uri $uri/ /index.php?$args; 27 | } 28 | 29 | location ~ \.php$ { 30 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 31 | include fastcgi_params; 32 | fastcgi_param SCRIPT_FILENAME $request_filename; 33 | fastcgi_intercept_errors on; 34 | fastcgi_pass unix:/var/run/php5-example.com.sock; 35 | } 36 | -------------------------------------------------------------------------------- /configs/instantcms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?$query_string; 5 | } 6 | 7 | location ~ ^/system/ { 8 | deny all; 9 | } 10 | 11 | location ~ ^/filters/ { 12 | deny all; 13 | } 14 | 15 | location ~ ^/languages/ { 16 | deny all; 17 | } 18 | 19 | location ~ ^/cache/ { 20 | deny all; 21 | } 22 | 23 | location ~* /static/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 24 | deny all; 25 | } 26 | 27 | location ~* /templates/.*\.(tpl|txt|php|php3|php4|php5|php6|phps|phtml)$ { 28 | deny all; 29 | } 30 | 31 | location ~* /upload/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 32 | deny all; 33 | } 34 | 35 | location ~* /wysiwyg/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 36 | deny all; 37 | } 38 | 39 | location /credits.txt { 40 | deny all; 41 | } 42 | 43 | location /readme.txt { 44 | deny all; 45 | } 46 | 47 | location ~ ^/license.(.*).txt$ { 48 | deny all; 49 | } 50 | 51 | location ~ /\. { 52 | deny all; 53 | } 54 | 55 | location /sitemap { 56 | rewrite ^/sitemap(.*).xml$ /cache/static/sitemaps/sitemap$1.xml; 57 | } 58 | 59 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 60 | expires 7d; 61 | } 62 | 63 | location ~ \.php$ { 64 | try_files $uri =404; 65 | include fastcgi_params; 66 | fastcgi_param SCRIPT_FILENAME $request_filename; 67 | fastcgi_intercept_errors on; 68 | fastcgi_pass unix:/var/run/php5-example.com.sock; 69 | } 70 | -------------------------------------------------------------------------------- /configs/ipb3.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | index index.php; 4 | try_files $uri $uri/ /index.php; 5 | 6 | location ~^(/page/).*(\.php)$ { 7 | try_files $uri $uri/ /index.php; 8 | } 9 | 10 | location /interface/ipsconnect/ipsconnect.php { 11 | deny all; 12 | } 13 | 14 | location ~^(/uploads/).*(\.php)$ { 15 | deny all; 16 | } 17 | 18 | location ~^(/hooks/).*(\.php)$ { 19 | deny all; 20 | } 21 | 22 | location ~^(/cache/).*(\.php)$ { 23 | deny all; 24 | } 25 | 26 | location ~^(/screenshots/).*(\.php)$ { 27 | deny all; 28 | } 29 | 30 | location ~^(/downloads/).*(\.php)$ { 31 | deny all; 32 | } 33 | 34 | location ~^(/blog/).*(\.php)$ { 35 | deny all; 36 | } 37 | 38 | location ~^(/public/style_).*(\.php)$ { 39 | deny all; 40 | } 41 | 42 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 43 | expires max; 44 | log_not_found off; 45 | } 46 | 47 | location ~ \.php$ { 48 | fastcgi_param PATH_INFO $path_info; 49 | fastcgi_pass unix:/var/run/php5-example.com.sock; 50 | fastcgi_index index.php; 51 | include fastcgi.conf; 52 | } 53 | -------------------------------------------------------------------------------- /configs/joomla-2-3.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?$args; 5 | } 6 | 7 | location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { 8 | return 403; 9 | } 10 | 11 | location ~ \.php$ { 12 | include fastcgi_params; 13 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 14 | fastcgi_pass unix:/var/run/php5-example.com.sock; 15 | } 16 | 17 | location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|bmp)$ { 18 | access_log off; 19 | expires 10d; 20 | break; 21 | } 22 | 23 | location ~ /\. { 24 | deny all; 25 | } 26 | -------------------------------------------------------------------------------- /configs/kodicms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/public; 2 | 3 | location ~ /\.svn { 4 | deny all; 5 | } 6 | 7 | location ~ /\.git { 8 | deny all; 9 | } 10 | 11 | location ~ /\.hg { 12 | deny all; 13 | } 14 | 15 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 16 | expires 7d; 17 | } 18 | 19 | location = /favicon.ico { 20 | log_not_found off; 21 | access_log off; 22 | } 23 | 24 | location = /robots.txt { 25 | allow all; 26 | log_not_found off; 27 | access_log off; 28 | } 29 | 30 | location ~ (^|/)\. { 31 | return 403; 32 | } 33 | 34 | location / { 35 | try_files $uri $uri/ /index.php?$query_string; 36 | } 37 | 38 | location /vendor/ { 39 | location ~ .*\.(js|css|png|jpg|jpeg|gif|ico)?$ { 40 | root /home/u1/domains/example.com; 41 | } 42 | } 43 | 44 | location ~ \.php$ { 45 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 46 | include fastcgi_params; 47 | fastcgi_param SCRIPT_FILENAME $request_filename; 48 | fastcgi_intercept_errors on; 49 | fastcgi_pass unix:/var/run/php5-example.com.sock; 50 | } 51 | -------------------------------------------------------------------------------- /configs/kohana.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri /index.php?$args; 5 | 6 | if (!-e $request_filename) { 7 | rewrite ^/(.*)$ /index.php/$1 last; 8 | } 9 | } 10 | 11 | location ~ /\. { 12 | deny all; 13 | } 14 | 15 | location ~ \.php$ { 16 | try_files $uri = 404; 17 | fastcgi_pass unix:/var/run/php5-example.com.sock; 18 | fastcgi_index index.php; 19 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 20 | include fastcgi_params; 21 | } 22 | 23 | location ~ /\. { 24 | deny all; 25 | } 26 | -------------------------------------------------------------------------------- /configs/laravel.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/public; 2 | 3 | location ~ /\. { 4 | deny all; 5 | } 6 | 7 | location = /favicon.ico { 8 | log_not_found off; 9 | access_log off; 10 | } 11 | 12 | location = /robots.txt { 13 | allow all; 14 | log_not_found off; 15 | access_log off; 16 | } 17 | 18 | location ~ (^|/)\. { 19 | return 403; 20 | } 21 | 22 | location / { 23 | try_files $uri $uri/ /index.php?$query_string; 24 | } 25 | 26 | location /vendor/ { 27 | location ~ .*\.(js|css|png|jpg|jpeg|gif|ico)?$ { 28 | root /home/u1/domains/example.com; 29 | } 30 | } 31 | 32 | location ~ \.php$ { 33 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 34 | include fastcgi_params; 35 | fastcgi_param SCRIPT_FILENAME $request_filename; 36 | fastcgi_intercept_errors on; 37 | fastcgi_pass unix:/var/run/php5-example.com.sock; 38 | } 39 | -------------------------------------------------------------------------------- /configs/livestreet.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?q=$uri&$args; 5 | } 6 | 7 | location ~* /templates/.*\.(tpl|php)$ { 8 | deny all; 9 | } 10 | 11 | location /tmp { 12 | deny all; 13 | } 14 | 15 | location ~ /\. { 16 | deny all; 17 | } 18 | 19 | location ~ \.(tpl|xml|log|sql)$ { 20 | deny all; 21 | } 22 | 23 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 24 | expires 7d; 25 | } 26 | 27 | location ~ \.php$ { 28 | include fastcgi_params; 29 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 30 | fastcgi_intercept_errors on; 31 | fastcgi_pass unix:/var/run/php5-example.com.sock; 32 | } 33 | -------------------------------------------------------------------------------- /configs/maxsite-cms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location ~ /\.svn { 4 | deny all; 5 | } 6 | 7 | location ~ /\.git { 8 | deny all; 9 | } 10 | 11 | location ~ /\.hg { 12 | deny all; 13 | } 14 | 15 | location = /favicon.ico { 16 | log_not_found off; 17 | access_log off; 18 | } 19 | 20 | location = /robots.txt { 21 | allow all; 22 | log_not_found off; 23 | access_log off; 24 | } 25 | 26 | location ~ (^|/)\. { 27 | return 403; 28 | } 29 | 30 | location / { 31 | try_files $uri $uri/ /index.php?$query_string; 32 | } 33 | 34 | location ~ \.php$ { 35 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 36 | include fastcgi_params; 37 | fastcgi_param SCRIPT_FILENAME $request_filename; 38 | fastcgi_intercept_errors on; 39 | fastcgi_pass unix:/var/run/php5-example.com.sock; 40 | } 41 | -------------------------------------------------------------------------------- /configs/mediawiki.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ @rewrite; 5 | } 6 | 7 | location @rewrite { 8 | rewrite ^/(.*)$ /index.php?title=$1; 9 | } 10 | 11 | location ^~ /maintenance/ { 12 | return 403; 13 | } 14 | 15 | location ~ \.php$ { 16 | fastcgi_param PATH_INFO $path_info; 17 | fastcgi_pass unix:/var/run/php5-example.com.sock; 18 | fastcgi_index index.php; 19 | include fastcgi.conf; 20 | } 21 | 22 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 23 | try_files $uri /index.php; 24 | expires max; 25 | log_not_found off; 26 | } 27 | 28 | location = /_.gif { 29 | expires max; 30 | } 31 | 32 | location ^~ /cache/ { 33 | deny all; 34 | } 35 | 36 | location /dumps { 37 | root /home/u1/domains/example.com/local; 38 | autoindex on; 39 | } 40 | 41 | location ~ /\.svn { 42 | deny all; 43 | } 44 | 45 | location ~ /\.git { 46 | deny all; 47 | } 48 | 49 | location ~ /\.hg { 50 | deny all; 51 | } 52 | -------------------------------------------------------------------------------- /configs/modx-revolution.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ @rewrite; 5 | } 6 | 7 | location /core { 8 | deny all; 9 | return 403; 10 | } 11 | 12 | location @rewrite { 13 | rewrite ^/(.*)$ /index.php?q=$1; 14 | } 15 | 16 | location ~ \.php$ { 17 | try_files $uri =404; 18 | include fastcgi_params; 19 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 20 | fastcgi_intercept_errors on; 21 | fastcgi_send_timeout 300; 22 | fastcgi_read_timeout 300; 23 | fastcgi_pass unix:/var/run/php5-example.com.sock; 24 | } 25 | 26 | location ~ /\.svn { 27 | deny all; 28 | } 29 | 30 | location ~ /\.git { 31 | deny all; 32 | } 33 | 34 | location ~ /\.hg { 35 | deny all; 36 | } 37 | -------------------------------------------------------------------------------- /configs/octobercms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location ~ /\.svn { 4 | deny all; 5 | } 6 | 7 | location ~ /\.git { 8 | deny all; 9 | } 10 | 11 | location ~ /\.hg { 12 | deny all; 13 | } 14 | 15 | location = /favicon.ico { 16 | log_not_found off; 17 | access_log off; 18 | } 19 | 20 | location = /robots.txt { 21 | allow all; 22 | log_not_found off; 23 | access_log off; 24 | } 25 | 26 | location ~ (^|/)\. { 27 | return 403; 28 | } 29 | 30 | location / { 31 | try_files $uri $uri/ /index.php?$query_string; 32 | } 33 | 34 | location ~ \.php$ { 35 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 36 | include fastcgi_params; 37 | fastcgi_param SCRIPT_FILENAME $request_filename; 38 | fastcgi_intercept_errors on; 39 | fastcgi_pass unix:/var/run/php5-example.com.sock; 40 | } 41 | -------------------------------------------------------------------------------- /configs/opencart-15.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | rewrite /vqmod/install$ $scheme://$host$uri/ permanent; 4 | 5 | location /vqmod/install/ { 6 | index index.php; 7 | } 8 | 9 | location = /sitemap.xml { 10 | rewrite ^(.*)$ /index.php?route=feed/google_sitemap break; 11 | } 12 | 13 | location = /googlebase.xml { 14 | rewrite ^(.*)$ /index.php?route=feed/google_base break; 15 | } 16 | 17 | location / { 18 | try_files $uri $uri/ @opencart; 19 | } 20 | 21 | location @opencart { 22 | rewrite ^/(.+)$ /index.php?_route_=$1 last; 23 | } 24 | 25 | location ~* \.(engine|inc|info|ini|install|log|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ { 26 | deny all; 27 | } 28 | 29 | location = /favicon.ico { 30 | log_not_found off; 31 | access_log off; 32 | } 33 | 34 | location = /apple-touch-icon.png { 35 | log_not_found off; 36 | access_log off; 37 | } 38 | 39 | location = /apple-touch-icon-precomposed.png { 40 | log_not_found off; 41 | access_log off; 42 | } 43 | 44 | location ~* \.(?:3gp|gif|jpg|jpe?g|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|woff)$ { 45 | expires max; 46 | add_header Pragma public; 47 | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; 48 | } 49 | 50 | location ~ ~$ { 51 | access_log off; 52 | log_not_found off; 53 | deny all; 54 | } 55 | 56 | location ~* /(?:cache|logs|image|download)/.*\.php$ { 57 | deny all; 58 | } 59 | 60 | location = /robots.txt { 61 | allow all; 62 | log_not_found off; 63 | access_log off; 64 | } 65 | 66 | location ~* \.(eot|otf|ttf|woff)$ { 67 | add_header Access-Control-Allow-Origin *; 68 | } 69 | 70 | location ~ [^/]\.php(/|$) { 71 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 72 | try_files $fastcgi_script_name =404; 73 | set $path_info $fastcgi_path_info; 74 | fastcgi_param PATH_INFO $path_info; 75 | fastcgi_pass unix:/var/run/php5-example.com.sock; 76 | fastcgi_index index.php; 77 | include fastcgi.conf; 78 | } 79 | -------------------------------------------------------------------------------- /configs/osticket.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | set $path_info ""; 4 | 5 | location / { 6 | try_files $uri $uri/ /index.php?$query_string; 7 | } 8 | 9 | location ~ /include { 10 | deny all; 11 | return 403; 12 | } 13 | 14 | if ($request_uri ~ "^/api(/[^\?]+)") { 15 | set $path_info $1; 16 | } 17 | 18 | location ~ ^/api/(?:tickets|tasks|auth).*$ { 19 | try_files $uri $uri/ /api/http.php?$query_string; 20 | } 21 | 22 | if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") { 23 | set $path_info $1; 24 | } 25 | 26 | location ~ ^/scp/ajax.php/.*$ { 27 | try_files $uri $uri/ /scp/ajax.php?$query_string; 28 | } 29 | 30 | if ($request_uri ~ "^/ajax\.php(/[^\?]+)") { 31 | set $path_info $1; 32 | } 33 | 34 | location ~ ^/ajax.php/.*$ { 35 | try_files $uri $uri/ /ajax.php?$query_string; 36 | } 37 | 38 | location ~ \.php$ { 39 | include fastcgi_params; 40 | fastcgi_param SCRIPT_FILENAME $request_filename; 41 | fastcgi_param PATH_INFO $path_info; 42 | fastcgi_intercept_errors on; 43 | fastcgi_pass unix:/var/run/php5-example.com.sock; 44 | } 45 | 46 | location ~ /\. { 47 | deny all; 48 | } 49 | 50 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 51 | expires 7d; 52 | } 53 | -------------------------------------------------------------------------------- /configs/phalcon.conf: -------------------------------------------------------------------------------- 1 | charset utf-8; 2 | 3 | root /home/u1/domains/example.com; 4 | index index.php index.html index.htm; 5 | 6 | location / { 7 | try_files $uri $uri/ /index.php?_url=$uri&$args; 8 | } 9 | 10 | location ~ /\. { 11 | deny all; 12 | } 13 | 14 | location ~ \.php { 15 | fastcgi_pass unix:/var/run/php5-example.com.sock; 16 | fastcgi_index /index.php; 17 | 18 | include fastcgi_params; 19 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 20 | fastcgi_param PATH_INFO $fastcgi_path_info; 21 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 22 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 23 | } 24 | -------------------------------------------------------------------------------- /configs/phpbb3.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | index index.php index.html index.htm; 5 | } 6 | 7 | location ~ /(config\.php|common\.php|includes|cache|files|store|images/avatars/upload) { 8 | deny all; 9 | internal; 10 | } 11 | 12 | location ~ \.php$ { 13 | fastcgi_pass unix:/var/run/php5-example.com.sock; 14 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 15 | include fastcgi_params; 16 | } 17 | 18 | location ~ /\. { 19 | deny all; 20 | } 21 | -------------------------------------------------------------------------------- /configs/prestashop-1-6.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location ~ /\. { 4 | deny all; 5 | } 6 | 7 | location ~* \.(eot|gif|ico|jpg|jpeg|otf|pdf|png|svg|swf|ttf|woff)$ { 8 | rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg break; 9 | rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg break; 10 | rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg break; 11 | rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg break; 12 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg break; 13 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg break; 14 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg break; 15 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg break; 16 | rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg break; 17 | rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg break; 18 | rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 break; 19 | 20 | rewrite ^/[a-zA-Z]+/img/cms/(.*)$ /img/cms/$1 break; 21 | expires 7d; 22 | add_header Cache-Control public; 23 | allow all; 24 | } 25 | 26 | location ~ \.(md|tpl|yml)$ { 27 | deny all; 28 | } 29 | 30 | location ~* /app { 31 | deny all; 32 | } 33 | 34 | location /api { 35 | rewrite ^/api/(.*)$ /webservice/dispatcher.php?url=$1; 36 | } 37 | 38 | location ~* /classes/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 39 | deny all; 40 | } 41 | 42 | location ~* /download { 43 | deny all; 44 | } 45 | 46 | location ~* /upload/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 47 | deny all; 48 | } 49 | 50 | location ~* /vendor/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 51 | deny all; 52 | } 53 | 54 | location ~* /log { 55 | deny all; 56 | } 57 | 58 | location ~* /tests/.*\.(php|php3|php4|php5|php6|phps|phtml|sh|xml|yml)$ { 59 | deny all; 60 | } 61 | 62 | location = /robots.txt { 63 | allow all; 64 | log_not_found off; 65 | access_log off; 66 | } 67 | 68 | location / { 69 | try_files $uri $uri/ /index.php?$args; 70 | } 71 | 72 | location ~ \.php$ { 73 | fastcgi_read_timeout 100; 74 | fastcgi_send_timeout 100; 75 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 76 | include fastcgi_params; 77 | fastcgi_param SCRIPT_FILENAME $request_filename; 78 | fastcgi_intercept_errors on; 79 | fastcgi_pass unix:/var/run/php5-example.com.sock; 80 | } 81 | -------------------------------------------------------------------------------- /configs/prestashop.conf: -------------------------------------------------------------------------------- 1 | root /path/to/prestashop; 2 | 3 | # Redirect 404 errors to prestashop 4 | error_page 404 /index.php?controller=404; 5 | 6 | # Cloudflare / Max CDN fix 7 | location ~* \.(eot|otf|ttf|woff(?:2)?)$ { 8 | add_header Access-Control-Allow-Origin *; 9 | } 10 | 11 | # Do not save logs for these 12 | location = /favicon.ico { 13 | auth_basic off; 14 | allow all; 15 | log_not_found off; 16 | access_log off; 17 | } 18 | 19 | location = /robots.txt { 20 | auth_basic off; 21 | allow all; 22 | log_not_found off; 23 | access_log off; 24 | } 25 | 26 | # [REQUIRED EDIT IF MULTILANG] 27 | 28 | # Images 29 | rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$1$2$3.jpg last; 30 | rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last; 31 | rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last; 32 | rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; 33 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; 34 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; 35 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; 36 | rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; 37 | rewrite ^/c/([0-9]+)(-[.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+.jpg$ /img/c/$1$2$3.jpg last; 38 | rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+.jpg$ /img/c/$1$2.jpg last; 39 | 40 | # AlphaImageLoader for IE and fancybox 41 | rewrite ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 last; 42 | 43 | # Web service API 44 | rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; 45 | 46 | # Installation sandbox 47 | rewrite ^(/install(?:-dev)?/sandbox)/(.*) /$1/test.php last; 48 | 49 | # [REQUIRED EDIT] Change this block to your admin folder 50 | location /admin-dev/ { 51 | if (!-e $request_filename) { 52 | rewrite ^/.*$ /admin-dev/index.php last; 53 | } 54 | } 55 | 56 | 57 | # File security 58 | # .htaccess .DS_Store .htpasswd etc 59 | location ~ /\. { 60 | deny all; 61 | } 62 | # Source code directories 63 | location ~ ^/(app|bin|cache|classes|config|controllers|docs|localization|override|src|tests|tools|translations|travis-scripts|vendor|var)/ { 64 | deny all; 65 | } 66 | # Prevent exposing other sensitive files 67 | location ~ \.(yml|log|tpl|twig|sass)$ { 68 | deny all; 69 | } 70 | 71 | # Prevent injection of php files 72 | location /upload { 73 | location ~ \.php$ { 74 | deny all; 75 | } 76 | } 77 | location /img { 78 | location ~ \.php$ { 79 | deny all; 80 | } 81 | } 82 | 83 | # PHP FPM part 84 | location ~ \.php$ { 85 | # Verify that the file exists, redirect to index if not 86 | try_files $fastcgi_script_name /index.php$uri&$args =404; 87 | 88 | # Environment variables for PHP 89 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 90 | 91 | include fastcgi_params; 92 | fastcgi_param PATH_INFO $fastcgi_path_info; 93 | fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; 94 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 95 | 96 | fastcgi_pass unix:/run/php/php7.0-fpm.sock; 97 | 98 | fastcgi_keep_conn on; 99 | fastcgi_read_timeout 30s; 100 | fastcgi_send_timeout 30s; 101 | 102 | # In case of long loading or 502 / 504 errors 103 | # fastcgi_buffer_size 256k; 104 | # fastcgi_buffers 256 16k; 105 | # fastcgi_busy_buffers_size 256k; 106 | client_max_body_size 10M; 107 | } 108 | -------------------------------------------------------------------------------- /configs/processwire-2.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location = /favicon.ico { 4 | log_not_found off; 5 | access_log off; 6 | } 7 | 8 | location = /robots.txt { 9 | allow all; 10 | log_not_found off; 11 | access_log off; 12 | } 13 | 14 | location / { 15 | try_files $uri $uri/ /index.php?it=$uri&$args; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 20 | include fastcgi_params; 21 | fastcgi_param SCRIPT_FILENAME $request_filename; 22 | fastcgi_intercept_errors on; 23 | fastcgi_pass unix:/var/run/php5-example.com.sock; 24 | try_files $uri =404; 25 | } 26 | 27 | location ~ /\. { 28 | deny all; 29 | } 30 | 31 | location ~ /(COPYRIGHT|LICENSE|README|htaccess)\.txt { 32 | deny all; 33 | } 34 | 35 | location ~ ^/site(-[^/]+)?/assets/(.*\.php|backups|cache|config|install|logs|sessions) { 36 | deny all; 37 | } 38 | 39 | location ~ ^/site(-[^/]+)?/install { 40 | deny all; 41 | } 42 | 43 | location ~ ^/(site(-[^/]+)?|wire)/(config(-dev)?|index\.config)\.php { 44 | deny all; 45 | } 46 | 47 | location ~ ^/((site(-[^/]+)?|wire)/modules|wire/core)/.*\.(inc|module|php|tpl) { 48 | deny all; 49 | } 50 | 51 | location ~ ^/(site(-[^/]+)?|wire)/templates(-admin)?/.*\.(inc|html?|php|tpl) { 52 | deny all; 53 | } 54 | 55 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 56 | expires 7d; 57 | } 58 | -------------------------------------------------------------------------------- /configs/subrion.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | index index.php; 4 | 5 | charset utf-8; 6 | 7 | location ~* ^/(favicon.ico|robots.txt)$ { 8 | allow all; 9 | access_log off; 10 | log_not_found off; 11 | } 12 | 13 | # route all requests to index.php 14 | location / { 15 | try_files $uri $uri/ /index.php?_p=$uri&$args; 16 | } 17 | 18 | location ~ \.php$ { 19 | fastcgi_pass unix:/var/run/php5-example.com.sock; 20 | fastcgi_index index.php; 21 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 22 | include fastcgi_params; 23 | } 24 | 25 | # route installation requests 26 | location /install/ { 27 | rewrite ^/install/(.*)$ /install/index.php?_p=$1; 28 | } 29 | 30 | # deny access to apache .htaccess files 31 | location ~ /\.ht 32 | { 33 | deny all; 34 | } 35 | 36 | # route admin dashboard requests 37 | location /admin/ { 38 | rewrite ^/admin/(.*)$ /index.php?_p=admin/$1&$args; 39 | } 40 | 41 | # cache static files 42 | location ~* ^.+.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv|woff|ttf) { 43 | access_log off; 44 | expires 30d; 45 | } -------------------------------------------------------------------------------- /configs/symfony.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/web; 2 | 3 | location / { 4 | try_files $uri /app.php$is_args$args; 5 | } 6 | 7 | location ~ ^/(app_dev|config)\.php(/|$) { 8 | fastcgi_pass unix:/var/run/php5-example.com.sock; 9 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 10 | include fastcgi_params; 11 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 12 | } 13 | 14 | location ~ ^/app\.php(/|$) { 15 | fastcgi_pass unix:/var/run/php5-example.com.sock; 16 | fastcgi_split_path_info ^(.+\.php)(/.*)$; 17 | include fastcgi_params; 18 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 19 | internal; 20 | } 21 | 22 | location ~ /\. { 23 | deny all; 24 | } 25 | -------------------------------------------------------------------------------- /configs/umi-cms.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | client_max_body_size 25m; 4 | 5 | location ~* \/\.ht { 6 | deny all; 7 | } 8 | 9 | location ~* ^\/(classes|errors\/logs|sys\-temp|cache|xmldb|static|packages) { 10 | deny all; 11 | } 12 | 13 | location ~* (\/for_del_connector\.php|\.ini|\.conf)$ { 14 | deny all; 15 | } 16 | 17 | location ~* ^(\/files\/|\/images\/|\/yml\/) { 18 | try_files $uri =404; 19 | } 20 | 21 | location ~* ^\/images\/autothumbs\/ { 22 | try_files $uri @autothumbs =404; 23 | } 24 | 25 | location @autothumbs { 26 | rewrite ^\/images\/autothumbs\/(.*)$ /autothumbs.php?img=$1$query_string last; 27 | } 28 | 29 | location @clean_url { 30 | rewrite ^/(.*)$ /index.php?path=$1 last; 31 | } 32 | 33 | location @dynamic { 34 | try_files $uri @clean_url; 35 | } 36 | 37 | location \/yml\/files\/ { 38 | try_files $uri =404; 39 | } 40 | 41 | location / { 42 | rewrite ^\/robots\.txt /sbots_custom.php?path=$1 last; 43 | rewrite ^\/sitemap\.xml /sitemap.php last; 44 | rewrite ^\/\~\/([0-9]+)$ /tinyurl.php?id=$1 last; 45 | rewrite ^\/(udata|upage|uobject|ufs|usel|ulang|utype|umess|uhttp):?(\/\/)?(.*)? /releaseStreams.php?scheme=$1&path=$3 last; 46 | rewrite ^\/(.*)\.xml$ /index.php?xmlMode=force&path=$1 last; 47 | rewrite ^(.*)\.json$ /index.php?jsonMode=force&path=$1 last; 48 | 49 | if ($cookie_umicms_session) { 50 | error_page 412 = @dynamic; 51 | return 412; 52 | } 53 | 54 | if ($request_method = 'POST') { 55 | error_page 412 = @dynamic; 56 | return 412; 57 | } 58 | 59 | index index.php; 60 | try_files $uri @dynamic; 61 | } 62 | 63 | location ~* \.js$ { 64 | rewrite ^\/(udata|upage|uobject|ufs|usel|ulang|utype|umess|uhttp):?(\/\/)?(.*)? /releaseStreams.php?scheme=$1&path=$3 last; 65 | try_files $uri =404; 66 | } 67 | 68 | location ~* \.(ico|jpg|jpeg|png|gif|swf|css|ttf)$ { 69 | try_files $uri =404; 70 | access_log off; 71 | expires 24h; 72 | } 73 | 74 | location ~ \.php$ { 75 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 76 | include fastcgi_params; 77 | fastcgi_param SCRIPT_FILENAME $request_filename; 78 | fastcgi_intercept_errors on; 79 | fastcgi_pass unix:/var/run/php5-example.com.sock; 80 | } 81 | -------------------------------------------------------------------------------- /configs/webasyst.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?$query_string; 5 | } 6 | 7 | location ~ /\. { 8 | deny all; 9 | } 10 | 11 | location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { 12 | expires 7d; 13 | } 14 | 15 | location ~ \.md5$ { 16 | deny all; 17 | } 18 | 19 | location ^~ /wa-data/protected/ { 20 | internal; 21 | } 22 | 23 | location ~* ^/wa-(log|config|cache|system)/ { 24 | deny all; 25 | } 26 | 27 | location ~ \.php$ { 28 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 29 | include fastcgi_params; 30 | fastcgi_param SCRIPT_FILENAME $request_filename; 31 | fastcgi_intercept_errors on; 32 | fastcgi_pass unix:/var/run/php5-example.com.sock; 33 | } 34 | -------------------------------------------------------------------------------- /configs/wordpress-4-supercache.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | set $cache_uri $request_uri; 4 | 5 | if ($request_method = POST) { 6 | set $cache_uri 'null cache'; 7 | } 8 | 9 | if ($query_string != "") { 10 | set $cache_uri 'null cache'; 11 | } 12 | 13 | if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { 14 | set $cache_uri 'null cache'; 15 | } 16 | 17 | if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { 18 | set $cache_uri 'null cache'; 19 | } 20 | 21 | location ~ /\. { 22 | deny all; 23 | } 24 | 25 | location = /favicon.ico { 26 | log_not_found off; 27 | access_log off; 28 | } 29 | 30 | location = /robots.txt { 31 | allow all; 32 | log_not_found off; 33 | access_log off; 34 | } 35 | 36 | location / { 37 | try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$query_string; 38 | } 39 | 40 | location ~ ^/wp-admin/includes/ { 41 | deny all; 42 | } 43 | 44 | location ~* /wp-includes/js/tinymce/wp-tinymce.php { 45 | allow all; 46 | include fastcgi.conf; 47 | fastcgi_intercept_errors on; 48 | fastcgi_pass unix:/var/run/php5-example.com.sock; 49 | } 50 | 51 | location ~* /wp-includes/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 52 | deny all; 53 | } 54 | 55 | location ~* /wp-content/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 56 | deny all; 57 | } 58 | 59 | location ~* /modules/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 60 | deny all; 61 | } 62 | 63 | location ~* /skins/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 64 | deny all; 65 | } 66 | 67 | location = /xmlrpc.php { 68 | deny all; 69 | } 70 | 71 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 72 | expires max; 73 | log_not_found off; 74 | } 75 | 76 | location ~* /(?:uploads|files)/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 77 | deny all; 78 | } 79 | 80 | location ~ \.php$ { 81 | include fastcgi.conf; 82 | fastcgi_intercept_errors on; 83 | fastcgi_pass unix:/var/run/php5-example.com.sock; 84 | } 85 | -------------------------------------------------------------------------------- /configs/wordpress-4.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location ~ /\. { 4 | deny all; 5 | } 6 | 7 | location = /favicon.ico { 8 | log_not_found off; 9 | access_log off; 10 | } 11 | 12 | location = /robots.txt { 13 | allow all; 14 | log_not_found off; 15 | access_log off; 16 | } 17 | 18 | location / { 19 | try_files $uri $uri/ /index.php?$query_string; 20 | } 21 | 22 | location ~ ^/wp-admin/includes/ { 23 | deny all; 24 | } 25 | 26 | location ~* /wp-includes/js/tinymce/wp-tinymce.php { 27 | allow all; 28 | include fastcgi.conf; 29 | fastcgi_intercept_errors on; 30 | fastcgi_pass unix:/var/run/php5-example.com.sock; 31 | } 32 | 33 | location ~* /wp-includes/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 34 | deny all; 35 | } 36 | 37 | location ~* /wp-content/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 38 | deny all; 39 | } 40 | 41 | location ~* /modules/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 42 | deny all; 43 | } 44 | 45 | location ~* /skins/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 46 | deny all; 47 | } 48 | 49 | location = /xmlrpc.php { 50 | deny all; 51 | } 52 | 53 | location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 54 | expires max; 55 | log_not_found off; 56 | } 57 | 58 | location ~* /(?:uploads|files)/.*\.(php|php3|php4|php5|php6|phps|phtml)$ { 59 | deny all; 60 | } 61 | 62 | location ~ \.php$ { 63 | include fastcgi.conf; 64 | fastcgi_intercept_errors on; 65 | fastcgi_pass unix:/var/run/php5-example.com.sock; 66 | } 67 | -------------------------------------------------------------------------------- /configs/yii-advanced.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/frontend/web; 2 | 3 | location ^~ /backend { 4 | rewrite ^/backend(.*)$ /backend/web$1 last; 5 | } 6 | 7 | location ^~ /backend/web { 8 | root /home/u1/domains/example.com; 9 | 10 | location ~ /\.(ht|svn|git) { 11 | deny all; 12 | } 13 | 14 | location ~ \.php$ { 15 | try_files $uri =404; 16 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 17 | include fastcgi_params; 18 | fastcgi_param SCRIPT_FILENAME $request_filename; 19 | fastcgi_intercept_errors on; 20 | fastcgi_pass unix:/var/run/php5-{domain}.sock; 21 | } 22 | } 23 | 24 | location / { 25 | try_files $uri $uri/ /index.php?$args; 26 | } 27 | 28 | location ~ ^/(protected|framework|themes/\w+/views) { 29 | deny all; 30 | } 31 | 32 | location ~ /\. { 33 | deny all; 34 | } 35 | 36 | location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { 37 | try_files $uri =404; 38 | } 39 | 40 | location ~ \.php$ { 41 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 42 | include fastcgi_params; 43 | fastcgi_param SCRIPT_FILENAME $request_filename; 44 | fastcgi_intercept_errors on; 45 | fastcgi_pass unix:/var/run/php5-example.com.sock; 46 | } 47 | -------------------------------------------------------------------------------- /configs/yii-basic.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/web; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php?$args; 5 | } 6 | 7 | location ~ ^/(protected|framework|themes/\w+/views) { 8 | deny all; 9 | } 10 | 11 | location ~ /\. { 12 | deny all; 13 | } 14 | 15 | location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { 16 | try_files $uri =404; 17 | } 18 | 19 | location ~ \.php$ { 20 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 21 | include fastcgi_params; 22 | fastcgi_param SCRIPT_FILENAME $request_filename; 23 | fastcgi_intercept_errors on; 24 | fastcgi_pass unix:/var/run/php5-example.com.sock; 25 | } 26 | -------------------------------------------------------------------------------- /configs/zencart-15.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com; 2 | 3 | location / { 4 | try_files $uri $uri/ index.php; 5 | } 6 | 7 | location /docs { 8 | if ($request_uri ~* (^\/|\.js|\.css|\.jpg|\.gif|\.png|\.html)$ ) { 9 | break; 10 | } 11 | return 403; 12 | } 13 | 14 | location /editors { 15 | if ($request_uri ~* (^\/|\.js|\.css|\.jpg|\.gif|\.png|\.html|\.xml)$ ) { 16 | break; 17 | } 18 | return 403; 19 | } 20 | 21 | location /email { 22 | if ($request_uri ~* (^\/|\.jpg|\.JPG|\.jpeg|\.JPEG|\.gif|\.GIF|\.png|\.PNG)$ ) { 23 | break; 24 | } 25 | return 403; 26 | } 27 | 28 | location /extras { 29 | if ($request_uri ~* (^\/|\.php|\.html)$ ) { 30 | break; 31 | } 32 | return 403; 33 | } 34 | 35 | location /images { 36 | if ($request_uri ~* (^\/|\.jpg|\.JPG|\.jpeg|\.JPEG|\.gif|\.GIF|\.png|\.PNG|\.swf|\.SWF|\.WMA)$) { 37 | break; 38 | } 39 | return 403; 40 | } 41 | 42 | location /(download|pub) { 43 | if ($request_uri ~* (^\/|\.zip|\.ZIP|\.gzip|\.pdf|\.PDF|\.mp3|\.MP3|\.swf|\.SWF|\.wma|\.WMA|\.wmv|\.WMV)$) { 44 | break; 45 | } 46 | return 403; 47 | } 48 | 49 | location /includes { 50 | if ($request_uri ~* (^\/|\.js|\.JS|\.css|\.CSS|\.jpg|\.JPG|\.gif|\.GIF|\.png|\.PNG|\.swf|\.SWF|\.xsl|\.XSL)$) { 51 | break; 52 | } 53 | return 403; 54 | } 55 | 56 | location /media { 57 | if ($request_uri ~* (^\/|\.mp3|\.mp4|\.swf|\.avi|\.mpg|\.wma|\.rm|\.ra|\.ram|\.wmv)$) { 58 | break; 59 | } 60 | return 403; 61 | } 62 | 63 | location /admin { 64 | if ($request_uri ~* (^\/|\.php|\.js|\.css|\.jpg|\.gif|\.png)$) { 65 | break; 66 | } 67 | return 403; 68 | } 69 | 70 | location = /robots.txt { 71 | access_log off; 72 | log_not_found off; 73 | } 74 | 75 | location = /favicon.ico { 76 | access_log off; 77 | error_log off; 78 | log_not_found off; 79 | } 80 | 81 | location ~ /\. { 82 | deny all; 83 | } 84 | 85 | location ~* \.php$ { 86 | fastcgi_pass unix:/var/run/php5-example.com.sock; 87 | fastcgi_index index.php; 88 | fastcgi_split_path_info ^(.+\.php)(.*)$; 89 | include fastcgi_params; 90 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 91 | } 92 | -------------------------------------------------------------------------------- /configs/zend-framework.conf: -------------------------------------------------------------------------------- 1 | root /home/u1/domains/example.com/public; 2 | 3 | location / { 4 | try_files $uri $uri/ /index.php$is_args$args; 5 | } 6 | 7 | location ~ \.php$ { 8 | fastcgi_pass unix:/var/run/php5-example.com.sock; 9 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 10 | include fastcgi_params; 11 | } 12 | 13 | location ~ /\.svn { 14 | deny all; 15 | } 16 | 17 | location ~ /\.git { 18 | deny all; 19 | } 20 | 21 | location ~ /\.hg { 22 | deny all; 23 | } 24 | --------------------------------------------------------------------------------