Skip to content

Instantly share code, notes, and snippets.

View pnommensen's full-sized avatar

Patrick Nommensen pnommensen

View GitHub Profile
@pnommensen
pnommensen / nginx ssl spdy
Last active August 29, 2015 13:57
nginx ssl spdy
## Use the Nginx Helper plugin to define cache purge rules and purge cache from dashboard
## Add the following three lines to /etc/nginx/nginx.conf
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
#inactive == if the page isn't accessed once during this time, it's deleted.
#keys_zone == name of the zone and max space allocation. If you have high ram, can mount as tmpfs.
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
server {
@pnommensen
pnommensen / WordPress functions.php 403 status incorrect login
Created July 10, 2014 16:44
WordPress functions.php 403 status incorrect login
function my_login_failed_403() {
status_header( 403 );
}
add_action( 'wp_login_failed', 'my_login_failed_403' );
Verifying that +pnommensen is my blockchain ID. https://onename.com/pnommensen
@pnommensen
pnommensen / varnish pass large files
Created February 7, 2014 17:52
pass large files for varnish
sub vcl_fetch {
# Bypass cache for files > 10 MB
if (std.integer(beresp.http.Content-Length, 0) > 10485760) {
return (hit_for_pass);
}
}
@pnommensen
pnommensen / gist:707b5519766ba45366dd
Last active February 18, 2024 21:52
Ghost CMS with NGINX for Maximum Performance

Full blog post can be found here: http://pnommensen.com/2014/09/07/high-performance-ghost-configuration-with-nginx/

Ghost is an open source platform for blogging founded by John O'Nolan and Hannah Wolfe. It's a node.js application and therefore works great in conjunction with nginx. This guide will will help you create a high performance nginx virtual host configuration for Ghost.

"Don't use #nodejs for static content" - @trevnorris. If #nginx isn't sitting in front of your node server, you're probably doing it wrong.

— Bryan Hughes (@nebrius) August 30, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

The node.js application runs on a port on your server