Skip to content

Instantly share code, notes, and snippets.

@jaw-sh
jaw-sh / haproxy.conf
Last active September 30, 2022 12:13
Zero trust haproxy ssl-over-tcp config
##
# zero trust haproxy ssl-over-tcp config
# this config can be put down on any small VPS to transfer traffic over to a trusted service
##
global
log /dev/log local0
log /dev/log local1 notice
# change to www on FreeBSD
user haproxy
group haproxy
@jaw-sh
jaw-sh / cloudflare.sh
Last active October 17, 2020 08:29
Bash file to pull Cloudflare IPs from their API endpoints. Can be used in CRON jobs.
#!/bin/bash
# Author: Joshua Moon <josh@jaw.sh>
# Date: 14-May-2016
# Purpose: Creates an up-to-date Cloudflare nginx config file.
# License: MIT
################################################################################
# INSTRUCTIONS
@jaw-sh
jaw-sh / gist:2dd0eb3be4c0845813e4
Last active October 17, 2020 10:50
NGINX catch-all for redirecting www and http to non-www https
# Redirect http:// to https://
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
# Redirect https://www to https://