This file contains hidden or 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
set $site $host; | |
# Strip www. prefix | |
if ($site ~ "^(w{3}\.)?(.*)$") { | |
set $site $2; | |
} | |
# Strip TLD prefix | |
if ($site ~ "^(.*)(\.[a-z]{3})$") { | |
set $site $1; |
This file contains hidden or 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
root@h5bp:~# which nginx | |
/usr/sbin/nginx | |
root@h5bp:~# su www-data | |
$ /usr/sbin/nginx -t | |
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied) | |
2014/12/14 10:38:43 [warn] 20279#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:5 | |
2014/12/14 10:38:43 [emerg] 20279#0: unknown directive "i" in /etc/nginx/nginx.conf:120 | |
nginx: configuration file /etc/nginx/nginx.conf test failed |
This file contains hidden or 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
iptables -F | |
# From https://www.cloudflare.com/ips | |
for ip in `curl https://www.cloudflare.com/ips-v4`; do | |
iptables -A INPUT -p tcp -s $ip --dport 80 -j ACCEPT | |
done | |
iptables -A INPUT -p tcp --dport 80 -j DROP |
This file contains hidden or 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
Adding phpunit.xml.dist and bootstrap.php to be able to run the unit … | |
…tests. The tests itself are not yet fixed / updated. |
This file contains hidden or 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 stackoverflow.com; | |
access_log /var/www/readonly.com/logs/access.log; | |
error_log /var/www/readonly.com/logs/error.log; | |
resolver 8.8.8.8 8.8.4.4 216.146.35.35 216.146.36.36; | |
location / { |
This file contains hidden or 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 default_server; | |
root /var/www/try-files-v-file-exists.com; | |
location ~* /try-files { | |
try_files $uri /tried.html; | |
} | |
location ~* /file-exists { |
This file contains hidden or 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
# Defaults for virtualbox initscript | |
# sourced by /etc/init.d/virtualbox | |
# installed at /etc/default/virtualbox by the maintainer scripts | |
# | |
# This is a POSIX shell fragment | |
# | |
# Set this to 1 if you would like the virtualbox modules to be loaded by | |
# the init script. |
This file contains hidden or 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
# Copy and paste into your .htaccess file or include in your apache conf files | |
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"' [OR] | |
RewriteCond %{HTTP_HOST} !^example.com$ [NC] | |
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] | |
# And remember to always use https for future requests | |
Header set Strict-Transport-Security "max-age=16070400; includeSubDomains" |
This file contains hidden or 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
# Edit this file to introduce tasks to be run by cron. | |
# | |
# Each task to run has to be defined through a single line | |
# indicating with different fields when the task will be run | |
# and what command to run for the task | |
# | |
# To define the time you can provide concrete values for | |
# minute (m), hour (h), day of month (dom), month (mon), | |
# and day of week (dow) or use '*' in these fields (for 'any').# | |
# Notice that tasks will be started based on the cron's system |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Untitled Document</title> | |
</head> | |
<body> | |
</body> | |
</html><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |