Skip to content

Instantly share code, notes, and snippets.

@kjprince
kjprince / NGINX Virtual Host
Created March 15, 2014 18:40
/etc/nginx/sites-available/mysite.com
# Virtual Host File
# Common wordpress configurations included in /etc/nginx/wordpress.conf
# All virtual hosts including this one are symlinked to /etc/nginx/sites-enabled
# Make sure you replace "mysite" with your domain name
server {
listen 80 default_server;
listen 443 ssl;
server_name mysite.com www.mysite.com *.mysite.com;
@kjprince
kjprince / local-config.php
Created March 14, 2014 06:09
local-config.php for wordpress
<?php
/*
This is a sample local-config.php file
In it, you *must* include the four main database defines
You may include other settings here that you only want enabled on your local development checkouts
This file should be ignored in your .gitignore file
*/
@kjprince
kjprince / alternative nginx.conf
Last active January 13, 2021 19:12
/etc/nginx/nginx.conf
# See this setup: http://polihronov.wordpress.com/
#
#
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
@kjprince
kjprince / Wordpress Nginx Config
Last active April 14, 2021 17:31
/etc/nginx/wordpress.conf
##################################
# WORDPRESS NGINX CONFIGURATIONS
##################################
# /etc/nginx/wordpress.conf
#
# Contains a common configuration for use by nginx on a WordPress
# installation. This file should be included in any WordPress site
# nginx virtual host config located in sites-available with the following line:
#
# include /etc/nginx/wordpress.config;
@kjprince
kjprince / Vagrantfile
Last active August 29, 2015 13:56
Vagrantfile for bootstrapping wordpress multi-site network
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "jeter"
config.vm.box_url = "~/Downloads/debian-wheezy64.box"
@kjprince
kjprince / puppet_bootstrap.sh
Last active August 29, 2015 13:56
Bootstrap your puppet installation on a fresh box
#!/usr/bin/env bash
# Pre install script to install the a specific version of puppet
# If no parameter is supplied, the lastest version will be installed
# Thanks to: https://gist.github.com/dol/5776169
# Corresponds to Vagrantfile line
VERSION=""
if [ -n "$1" ]
then
VERSION="$1"
fi
# ------------------------------------------------------------------------
# REMOVE WWW PREFIX ------------------------------------------------------
# ------------------------------------------------------------------------
server {
server_name *.[sitename];
# remove all sub domains and www
rewrite ^/(.*)$ http://[sitename]/$1 permanent;
}
# ------------------------------------------------------------------------
# REMOVE WWW PREFIX ------------------------------------------------------
# ------------------------------------------------------------------------
server {
server_name *.[sitename];
# remove all sub domains and www
rewrite ^/(.*)$ http://[sitename]/$1 permanent;
}