Skip to content

Instantly share code, notes, and snippets.

0x4f000Bcf4641E2fDcE85BF26A694b053996850D4
@knowncolor
knowncolor / iptables.firewall.rules
Last active August 29, 2015 14:19
Default-Deny iptables Firewall Rules for Raspberry Pi Webserver
*filter
# Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 -j REJECT
# Accept all established inbound & outbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
@knowncolor
knowncolor / jamesoliveradams.com
Last active August 29, 2015 14:16
Nginx SSL server configuration for A+ Result on SSLLabs.com
server {
server_name jamesoliveradams.com;
listen 80;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl spdy;
# Get SSL setup
@knowncolor
knowncolor / nginx.conf
Last active December 16, 2017 16:27
Nginx configuration file with improved security and optimized for the Raspberry Pi.
user www-data;
worker_processes 2;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
# Basic Settings
@knowncolor
knowncolor / build_nginx.sh
Last active August 29, 2015 14:16 — forked from MattWilcox/build_nginx.sh
Bash script to download, configure and install the latest OpenSSL configured nginx on your Raspbian Raspberry Pi
#!/usr/bin/env bash
# install and remove nginx via apt-get
# this sets up a lot of things which we would have to do manually otherwise
sudo apt-get -y install nginx
sudo apt-get -y remove nginx
# set up build directories
export BUILD_DIR=nginx-build
rm -rf $BUILD_DIR