Last active
April 10, 2018 19:45
-
-
Save WganMe/cc8d14bcd4e0142db1228b417e69d99e to your computer and use it in GitHub Desktop.
pre_virtualhost_global.conf
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
Header unset X-Powered-By | |
AddDefaultCharset UTF-8 | |
AddLanguage en-US .html .htm .css .js | |
AddCharset utf-8 .atom .css .js .json .rss .vtt .xml | |
#SetEnv SA Asia/Riyadh | |
Header set X-Frame-Options SAMEORIGIN | |
Header set X-XSS-Protection "1; mode=block" | |
Header set X-Content-Security-Policy "allow 'self';" | |
Header set X-Content-Type-Options "nosniff" | |
ServerSignature Off | |
SetEnvIf Range (,.*?){5,} bad-range=1 | |
RequestHeader unset Range env=bad-range | |
LimitRequestBody 2147483647 | |
<IfModule php71_module> | |
php_value session.cookie_httponly true | |
</IfModule> | |
<IfModule mod_suphp.c> | |
<Files php.ini> | |
order allow,deny | |
deny from all | |
</Files> | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header set X-UA-Compatible "IE=Edge,chrome=1" | |
# mod_headers cannnot match by content-type, but we don't want to send this header on *everything*... | |
<FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|oex|xpi|safariextz|vcf)$" > | |
Header unset X-UA-Compatible | |
</FilesMatch> | |
#Header set P3P "policyref="/w3c/p3p.xml", CP="NOI DSP COR NID CUR ADM DEV OUR BUS"" | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header set Access-Control-Allow-Origin "*" | |
</IfModule> | |
<IfModule mod_setenvif.c> | |
<IfModule mod_headers.c> | |
# mod_headers, y u no match by Content-Type?! | |
<FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$"> | |
SetEnvIf Origin ":" IS_CORS | |
Header set Access-Control-Allow-Origin "*" env=IS_CORS | |
</FilesMatch> | |
</IfModule> | |
</IfModule> | |
<IfModule mod_headers.c> | |
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$"> | |
Header set Access-Control-Allow-Origin "*" | |
</FilesMatch> | |
</IfModule> | |
AddType application/javascript js jsonp | |
AddType application/json json | |
AddType audio/ogg oga ogg | |
AddType audio/mp4 m4a f4a f4b | |
AddType video/ogg ogv | |
AddType video/mp4 mp4 m4v f4v f4p | |
AddType video/webm webm | |
AddType video/x-flv flv | |
AddType image/svg+xml svg svgz | |
AddEncoding gzip svgz | |
AddType application/vnd.ms-fontobject eot | |
AddType application/x-font-ttf ttf ttc | |
AddType font/opentype otf | |
AddType application/x-font-woff woff | |
AddType image/x-icon ico | |
AddType image/webp webp | |
AddType text/cache-manifest appcache manifest | |
AddType text/x-component htc | |
AddType application/xml rss atom xml rdf | |
AddType application/x-chrome-extension crx | |
AddType application/x-opera-extension oex | |
AddType application/x-xpinstall xpi | |
AddType application/octet-stream safariextz | |
AddType application/x-web-app-manifest+json webapp | |
AddType text/x-vcard vcf | |
AddType application/x-shockwave-flash swf | |
AddType text/vtt vtt | |
# | |
# | |
# ---------------------------------------------------------------------- | |
# Allow concatenation from within specific js and css files | |
# ---------------------------------------------------------------------- | |
# e.g. Inside of script.combined.js you could have | |
# <!--#include file="libs/jquery-1.5.0.min.js" --> | |
# <!--#include file="plugins/jquery.idletimer.js" --> | |
# and they would be included into this single file. | |
# This is not in use in the boilerplate as it stands. You may | |
# choose to use this technique if you do not have a build process. | |
<FilesMatch "\.combined\.js$"> | |
Options +Includes | |
AddOutputFilterByType INCLUDES application/javascript application/json | |
SetOutputFilter INCLUDES | |
</FilesMatch> | |
<FilesMatch "\.combined\.css$"> | |
Options +Includes | |
AddOutputFilterByType INCLUDES text/css | |
SetOutputFilter INCLUDES | |
</FilesMatch> | |
<IfModule mod_gzip.c> | |
mod_gzip_on Yes | |
mod_gzip_dechunk Yes | |
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ | |
mod_gzip_item_include handler ^cgi-script$ | |
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.* | |
</IfModule> | |
<IfModule mod_deflate.c> | |
<IfModule mod_setenvif.c> | |
<IfModule mod_headers.c> | |
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding | |
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding | |
</IfModule> | |
</IfModule> | |
<IfModule mod_filter.c> | |
AddOutputFilterByType DEFLATE application/atom+xml \ | |
application/javascript \ | |
application/json \ | |
application/rss+xml \ | |
application/vnd.ms-fontobject \ | |
application/x-font-ttf \ | |
application/xhtml+xml \ | |
application/xml \ | |
font/opentype \ | |
image/svg+xml \ | |
image/x-icon \ | |
text/css \ | |
text/html \ | |
text/plain \ | |
text/x-component \ | |
text/xml | |
</IfModule> | |
</IfModule> | |
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"> | |
ExpiresDefault A29030400 | |
</FilesMatch> | |
<IfModule mod_expires.c> | |
ExpiresActive on | |
ExpiresDefault "access plus 1 month" | |
ExpiresByType text/cache-manifest "access plus 0 seconds" | |
ExpiresByType text/html "access plus 0 seconds" | |
ExpiresByType text/xml "access plus 0 seconds" | |
ExpiresByType application/xml "access plus 0 seconds" | |
ExpiresByType application/json "access plus 0 seconds" | |
ExpiresByType application/rss+xml "access plus 1 hour" | |
ExpiresByType application/atom+xml "access plus 1 hour" | |
ExpiresByType image/x-icon "access plus 1 month" | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/png "access plus 1 month" | |
ExpiresByType image/jpeg "access plus 1 month" | |
ExpiresByType video/ogg "access plus 1 month" | |
ExpiresByType audio/ogg "access plus 1 month" | |
ExpiresByType video/mp4 "access plus 1 month" | |
ExpiresByType video/webm "access plus 1 month" | |
ExpiresByType text/x-component "access plus 1 month" | |
ExpiresByType application/x-font-ttf "access plus 1 month" | |
ExpiresByType font/opentype "access plus 1 month" | |
ExpiresByType application/x-font-woff "access plus 1 month" | |
ExpiresByType image/svg+xml "access plus 1 month" | |
ExpiresByType application/vnd.ms-fontobject "access plus 1 month" | |
ExpiresByType text/css "access plus 1 year" | |
ExpiresByType application/javascript "access plus 1 year" | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header set Cache-Control "no-transform" | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header unset ETag | |
</IfModule> | |
FileETag None | |
BrowserMatch "MSIE" brokenvary=1 | |
BrowserMatch "Mozilla/4.[0-9]{2}" brokenvary=1 | |
BrowserMatch "Opera" !brokenvary | |
SetEnvIf brokenvary 1 force-no-vary | |
<IfModule mod_headers.c> | |
Header set Connection Keep-Alive | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
Options +FollowSymlinks | |
# RewriteBase / | |
# | |
## Force public directory for the rood of websites ## | |
# Change ludo237.github to be your primary domain. | |
# | |
# RewriteCond %{HTTP_HOST} ^(www.)?ludo237.github$ | |
# | |
# Change 'subfolder' to be the folder you will use for your primary domain. | |
# | |
RewriteCond %{REQUEST_URI} !^/repositories/ | |
# | |
# Do not change this line. | |
# | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
# | |
# Change 'subfolder' to be the folder you will use for your primary domain. | |
# | |
# RewriteRule ^(.*)$ /repositories/$1 | |
# Change ludo237.github to be your primary domain again. | |
# Change 'subfolder' to be the folder you will use for your primary domain | |
# followed by / then the main file for your site, index.php, index.html, etc. | |
# RewriteCond %{HTTP_HOST} ^(www.)?ludo237.github$ | |
# RewriteRule ^(.*)$ http://ludo237.github/$1 [R,L] | |
# | |
## Remove Extensions ## | |
# change the .php extension with whatever you need | |
# | |
# RewriteCond %{REQUEST_FILENAME} !-d | |
# RewriteCond %{REQUEST_FILENAME}\.php -f | |
# RewriteRule ^(.*)$ $1.php | |
# | |
## Remove Bad Bots from crawling ## | |
# IF THE UA STARTS WITH THESE | |
# Block spambots | |
# | |
RewriteCond %{HTTP_USER_AGENT} ^(aesop_com_spiderman|alexibot|backweb|bandit|batchftp|bigfoot) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(black.?hole|blackwidow|blowfish|botalot|buddy|builtbottough|bullseye) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(cheesebot|cherrypicker|chinaclaw|collector|copier|copyrightcheck) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(cosmos|crescent|curl|custo|da|diibot|disco|dittospyder|dragonfly) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(drip|easydl|ebingbong|ecatch|eirgrabber|emailcollector|emailsiphon) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(emailwolf|erocrawler|exabot|eyenetie|filehound|flashget|flunky) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(frontpage|getright|getweb|go.?zilla|go-ahead-got-it|gotit|grabnet) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(grafula|harvest|hloader|hmview|httplib|httrack|humanlinks|ilsebot) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(infonavirobot|infotekies|intelliseek|interget|iria|jennybot|jetcar) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(joc|justview|jyxobot|kenjin|keyword|larbin|leechftp|lexibot|lftp|libweb) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(likse|linkscan|linkwalker|lnspiderguy|lwp|magnet|mag-net|markwatch) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(mata.?hari|memo|microsoft.?url|midown.?tool|miixpc|mirror|missigua) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(mister.?pix|moget|mozilla.?newt|nameprotect|navroad|backdoorbot|nearsite) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(net.?vampire|netants|netcraft|netmechanic|netspider|nextgensearchbot) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(attach|nicerspro|nimblecrawler|npbot|octopus|offline.?explorer) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(offline.?navigator|openfind|outfoxbot|pagegrabber|papa|pavuk) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(pcbrowser|php.?version.?tracker|pockey|propowerbot|prowebwalker) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(psbot|pump|queryn|recorder|realdownload|reaper|reget|true_robot) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(repomonkey|rma|internetseer|sitesnagger|siphon|slysearch|smartdownload) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(snake|snapbot|snoopy|sogou|spacebison|spankbot|spanner|sqworm|superbot) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(superhttp|surfbot|asterias|suzuran|szukacz|takeout|teleport) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(telesoft|the.?intraformant|thenomad|tighttwatbot|titan|urldispatcher) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(turingos|turnitinbot|urly.?warning|vacuum|vci|voideye|whacker) [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^(libwww-perl|widow|wisenutbot|wwwoffle|xaldon|xenu|zeus|zyborg|anonymouse) [NC,OR] | |
# | |
## STARTS WITH WEB | |
# | |
RewriteCond %{HTTP_USER_AGENT} ^web(zip|emaile|enhancer|fetch|go.?is|auto|bandit|clip|copier|master|reaper|sauger|site.?quester|whack) [NC,OR] | |
# | |
## ANYWHERE IN UA -- GREEDY REGEX | |
# | |
RewriteCond %{HTTP_USER_AGENT} ^.*(craftbot|download|extract|stripper|sucker|ninja|clshttp|webspider|leacher|collector|grabber|webpictures).*$ [NC] | |
# | |
## ISSUE 403 / SERVE ERRORDOCUMENT | |
# | |
RewriteRule . - [F,L] | |
# | |
## Useragents starting with | |
# | |
RewriteCond %{HTTP_USER_AGENT} ^atraxbot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^Azureus [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^geohasher [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^PycURL [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^Python-urllib [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^research-scan-bot [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^Sosospider [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^Wget [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^xenu [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*casper [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*goblox [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*sun4u [NC] | |
RewriteRule ^(.*)$ - [F] | |
RewriteCond %{HTTP_REFERER} ^$ [NC] | |
RewriteCond %{HTTP_USER_AGENT} ^$ [NC] | |
RewriteRule .* - [F,L] | |
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC,OR] | |
RewriteCond %{THE_REQUEST} ^.*(\\r|\\n|%0A|%0D).* [NC,OR] | |
RewriteCond %{HTTP_COOKIE} ^.*(<|>|'|'|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR] | |
RewriteCond %{REQUEST_URI} ^/(,|;|:|<|>|">|"<|/|\\\.\.\\).{0,9999}.* [NC,OR] | |
RewriteCond %{HTTP_USER_AGENT} ^.*(<|>|'|'|%0A|%0D|%27|%3C|%3E|%00).* [NC,OR] | |
RewriteCond %{QUERY_STRING} ^.*(;|<|>|'|"|"|'|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|cast|set|declare|drop|update|md5|benchmark).* [NC,OR] | |
RewriteCond %{QUERY_STRING} ^.*(localhost|loopback|127\.0\.0\.1).* [NC,OR] | |
RewriteCond %{QUERY_STRING} ^.*(<|>|'|'|%0A|%0D|%27|%3C|%3E|%00).* [NC] | |
RewriteCond %{REQUEST_METHOD} GET | |
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR] | |
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR] | |
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC] | |
RewriteRule .* - [F] | |
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http%3A%2F%2F [OR] | |
RewriteCond %{QUERY_STRING} proc\/self\/environ [NC,OR] | |
RewriteCond %{QUERY_STRING} ^(%2d|\-)[^=]+$ [NC] | |
RewriteRule (.*) - [F,L] | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteCond %{HTTPS} !=on | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] | |
</IfModule> | |
# | |
# | |
# ---------------------------------------------------------------------- | |
# Prevent SSL cert warnings | |
# ---------------------------------------------------------------------- | |
# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent | |
# https://www.example.com when your cert only allows https://secure.example.com | |
# <IfModule mod_rewrite.c> | |
# RewriteCond %{SERVER_PORT} !^443 | |
# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L] | |
# </IfModule> | |
Options -MultiViews | |
ErrorDocument 100 /error.php | |
ErrorDocument 101 /error.php | |
ErrorDocument 102 /error.php | |
ErrorDocument 200 /error.php | |
ErrorDocument 201 /error.php | |
ErrorDocument 202 /error.php | |
ErrorDocument 203 /error.php | |
ErrorDocument 204 /error.php | |
ErrorDocument 205 /error.php | |
ErrorDocument 206 /error.php | |
ErrorDocument 207 /error.php | |
ErrorDocument 300 /error.php | |
ErrorDocument 301 /error.php | |
ErrorDocument 302 /error.php | |
ErrorDocument 303 /error.php | |
ErrorDocument 304 /error.php | |
ErrorDocument 305 /error.php | |
ErrorDocument 307 /error.php | |
ErrorDocument 400 /error.php | |
ErrorDocument 401 /error.php | |
ErrorDocument 402 /error.php | |
ErrorDocument 403 /error.php | |
ErrorDocument 404 /error.php | |
ErrorDocument 405 /error.php | |
ErrorDocument 406 /error.php | |
ErrorDocument 407 /error.php | |
ErrorDocument 408 /error.php | |
ErrorDocument 409 /error.php | |
ErrorDocument 410 /error.php | |
ErrorDocument 411 /error.php | |
ErrorDocument 412 /error.php | |
ErrorDocument 413 /error.php | |
ErrorDocument 414 /error.php | |
ErrorDocument 415 /error.php | |
ErrorDocument 416 /error.php | |
ErrorDocument 417 /error.php | |
ErrorDocument 422 /error.php | |
ErrorDocument 423 /error.php | |
ErrorDocument 424 /error.php | |
ErrorDocument 426 /error.php | |
ErrorDocument 500 /error.php | |
ErrorDocument 501 /error.php | |
ErrorDocument 502 /error.php | |
ErrorDocument 503 /error.php | |
ErrorDocument 504 /error.php | |
ErrorDocument 505 /error.php | |
ErrorDocument 506 /error.php | |
ErrorDocument 507 /error.php | |
ErrorDocument 510 /error.php | |
IndexIgnore * | |
<IfModule mod_autoindex.c> | |
Options -Indexes | |
</IfModule> | |
<IfModule mod_rewrite.c> | |
RewriteCond %{SCRIPT_FILENAME} -d [OR] | |
RewriteCond %{SCRIPT_FILENAME} -f | |
RewriteRule "(^|/)\." - [F] | |
</IfModule> | |
<FilesMatch "(\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist)|~)$"> | |
Order allow,deny | |
Deny from all | |
Satisfy All | |
</FilesMatch> | |
AddHandler cgi-script .pl .py .asp .shtml .sh .cgi | |
<IfModule mod_php71.c> | |
php_value assert.active 0 | |
php_flag session.auto_start off | |
php_value mbstring.http_input pass | |
php_value mbstring.http_output pass | |
php_flag mbstring.encoding_translation off | |
php_value always_populate_raw_post_data -1 | |
#pcre.backtrack_limit 1000000 | |
#pcre.recursion_limit 1000000 | |
php_value upload_max_filesize 18G | |
php_value post_max_size 18G | |
php_value memory_limit 2G | |
php_value mbstring.func_overload 0 | |
php_value default_charset 'UTF-8' | |
php_value output_buffering 0 | |
php_flag register_globals Off | |
php_value session.name XGOSID | |
php_flag magic_quotes_gpc Off | |
php_flag expose_php Off | |
php_value error_reporting -1 | |
php_flag log_errors On | |
php_flag display_errors Off | |
php_flag display_startup_errors Off | |
php_flag html_errors Off | |
php_flag ignore_repeated_errors Off | |
php_flag ignore_repeated_source Off | |
php_value log_errors_max_len 1024 | |
php_value error_prepend_string " " | |
php_value error_append_string " " | |
<IfModule mod_env.c> | |
SetEnv htaccessWorking true | |
</IfModule> | |
</IfModule> | |
<IfModule mod_headers.c> | |
Header set Strict-Transport-Security "max-age=10886400" env=HTTPS | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment