Skip to content

Instantly share code, notes, and snippets.

View zanematthew's full-sized avatar

Zane Matthew zanematthew

View GitHub Profile
@rkaramandi
rkaramandi / nginx-and-certbot-config.md
Last active February 15, 2024 21:20
Running NGINX and CertBot Containers on the Same Host

Running NGINX and CertBot Containers on the Same Host

The Problem

A lot of people run into the problem of running Let's Encrypt's CertBot Tool and an NGINX on the same container host. A big part of this has to do with CertBot needing either port 80 or 443 open for the tool to work as intended. This tends to conflict with NGINX as most people usually use port 80 (HTTP) or 443 (HTTPS) for their reverse proxy. Section 1 outlines how to configure NGINX to get this to work, and Section 2 is the Docker command to run CertBot.

1. NGINX Configuration

I use Docker Compose (docker-compose) for my NGINX server. My docker-compose.yml file looks something like this:

@Camwyn
Camwyn / .gitconfig
Last active July 29, 2020 15:19
My aliases for git
[alias]
# archive a branch
ab = !sh -c 'git checkout $1 && git pull && git tag archive/$1 && git push origin $1 && git push origin archive/$1 && git checkout master && git branch -D $1 && git push origin --delete $1' -
# archive a branch (to a remote other than origin)
abb = !sh -c 'git checkout $1 && git pull $2 $1 && git tag archive/$1 && git push $2 $1 && git push $2 archive/$1 && git checkout master && git branch -D $1 && git push $2 --delete $1' -
# list aliases
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
@simoncoulton
simoncoulton / gitkeep
Created January 8, 2014 05:42
Create empty gitkeep files in directories that are empty
find . -type d -empty -exec touch {}/.gitkeep \;
@markjaquith
markjaquith / gist:2653957
Created May 10, 2012 15:36
WordPress Fragment Caching convenience wrapper
<?php
/*
Usage:
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL
if ( !$frag->output() ) { // NOTE, testing for a return of false
functions_that_do_stuff_live();
these_should_echo();
// IMPORTANT
$frag->store();
// YOU CANNOT FORGET THIS. If you do, the site will break.
@timcrider
timcrider / virtualhost.conf
Created November 23, 2011 20:54
Apache 'no reboot needed' virtual host configuration for development sites.
###############################################################################
#
# Apache virtual host 'no reboot needed' template.
#
# This apache virtualhost configuration allows a user to create development
# sites on the fly. This will not work out of the box however, you will need
# to replace the {variables} in this conf with values explained below. This
# can be done with a script, or a simple find and replace in your favorite
# editor.
#
@scribu
scribu / plugin-deploy.sh
Created August 4, 2011 12:18
Plugin deploy
#!/usr/bin/env bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/$DIR_NAME/$BRANCH
@certik
certik / gist:735587
Created December 10, 2010 00:47
.gitconfig
[user]
name = Ondrej Certik
email = ondrej@certik.cz
[color]
ui = auto
interactive = true
[alias]
ci = commit