... | ... | @@ -26,6 +26,15 @@ |
|
|
|
|
|
#### Bloqueio de Bots indesejados que entopem o servidor #####
|
|
|
|
|
|
## Automated HTTP libraries
|
|
|
RewriteCond %{HTTP_USER_AGENT} ^.*(dav.pm/v|libwww-perl|urllib|python-requests|python-httplib2|winhttp.winhttprequest|lwp-request|lwp-trivial|fasthttp|Go-http-client|Java|httplib|httpclient|Zend_Http_Client).*$ [NC]
|
|
|
RewriteRule .* - [F,L]
|
|
|
|
|
|
## Commonly seen in DDoS attacks
|
|
|
RewriteCond %{HTTP_USER_AGENT} ^.*(CtrlFunc|w00tw00t|Apachebench).*$ [NC]
|
|
|
RewriteRule .* - [F,L]
|
|
|
|
|
|
|
|
|
RewriteCond %{HTTP_USER_AGENT} MJ12bot
|
|
|
RewriteRule .* - [F]
|
|
|
RewriteCond %{HTTP_USER_AGENT} 80legs [NC]
|
... | ... | @@ -36,17 +45,15 @@ |
|
|
AddType image/svg+xml svg svgz
|
|
|
AddEncoding gzip svgz
|
|
|
AddType text/x-component .htc
|
|
|
DirectoryIndex index.html index.php
|
|
|
DirectoryIndex index.html index.php
|
|
|
|
|
|
##### Configuração padrão do php do projeto #####
|
|
|
|
|
|
<IfModule mod_php5.c>
|
|
|
php_value memory_limit 512M
|
|
|
php_value max_execution_time 18000
|
|
|
php_flag magic_quotes_gpc off
|
|
|
php_flag session.auto_start off
|
|
|
php_flag suhosin.session.cryptua off
|
|
|
php_flag zend.ze1_compatibility_mode Off
|
|
|
<IfModule mod_php5.c>
|
|
|
php_flag magic_quotes_gpc off
|
|
|
php_flag session.auto_start off
|
|
|
php_flag suhosin.session.cryptua off
|
|
|
php_flag zend.ze1_compatibility_mode Off
|
|
|
</IfModule>
|
|
|
|
|
|
|
... | ... | @@ -59,10 +66,10 @@ |
|
|
RewriteRule ^downloader/ - [L,R=403]
|
|
|
|
|
|
##Forçar o uso do www
|
|
|
#RewriteCond %{HTTP_HOST} !=""
|
|
|
#RewriteCond %{HTTP_HOST} !^www\. [NC]
|
|
|
#RewriteCond %{HTTPS}s ^on(s)|
|
|
|
#RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
|
|
RewriteCond %{HTTP_HOST} !=""
|
|
|
RewriteCond %{HTTP_HOST} !^www\. [NC]
|
|
|
RewriteCond %{HTTPS}s ^on(s)|
|
|
|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
|
|
|
|
|
##Reescreva as chamadas da API2 para api.php (agora é apenas REST)
|
|
|
|
... | ... | @@ -105,11 +112,11 @@ |
|
|
</IfModule>
|
|
|
|
|
|
<Files *.php>
|
|
|
SetOutputFilter DEFLATE
|
|
|
SetOutputFilter DEFLATE
|
|
|
</Files>
|
|
|
|
|
|
<IfModule mod_ssl.c>
|
|
|
SSLOptions StdEnvVars
|
|
|
SSLOptions StdEnvVars
|
|
|
</IfModule>
|
|
|
|
|
|
##### Cabeçalho #####
|
... | ... | @@ -121,10 +128,10 @@ |
|
|
|
|
|
##### disable POST processing to not break multiple image upload #####
|
|
|
|
|
|
<IfModule mod_security.c>
|
|
|
#SecRuleEngine Off
|
|
|
<IfModule mod_security.c>
|
|
|
#SecRuleEngine Off
|
|
|
SecFilterScanPOST Off
|
|
|
</IfModule>
|
|
|
</IfModule>
|
|
|
|
|
|
##### Modifique o gzip e o armazenamento em cache para melhorar a velocidade do site #####
|
|
|
|
... | ... | @@ -136,7 +143,7 @@ |
|
|
mod_gzip_item_include mime ^text/.*
|
|
|
mod_gzip_item_include mime ^application/x-javascript.*
|
|
|
mod_gzip_item_exclude mime ^image/.*
|
|
|
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
|
|
|
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
|
|
|
</ifModule>
|
|
|
|
|
|
##### O padrão expira cabeçalhos para todos os tipos de arquivo #####
|
... | ... | @@ -152,7 +159,7 @@ |
|
|
ExpiresByType text/css "access plus 604800 seconds"
|
|
|
ExpiresByType text/javascript "access plus 216000 seconds"
|
|
|
ExpiresByType application/x-javascript "access plus 216000 seconds"
|
|
|
</ifModule>
|
|
|
</ifModule>
|
|
|
|
|
|
##### Mime Type Cache #####
|
|
|
|
... | ... | |