Skip to content

Instantly share code, notes, and snippets.


Yi Huang cras4202tw

Block or report user

Report or block cras4202tw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mwpastore /
Last active Oct 15, 2019
Lightning Fast WordPress: Caddy+Varnish+PHP-FPM


This gist assumes you are migrating an existing site for — ideally WordPress — to a new server — ideally Ubuntu Server 16.04 LTS — and wish to enable HTTP/2 (backwards compatibile with HTTP/1.1) with always-on HTTPS, caching, compression, and more. Although these instructions are geared towards WordPress, they should be trivially extensible to other PHP frameworks, other FastCGI backends, and even non-FastCGI backends (using proxy in lieu of fastcgi in the terminal Caddyfile stanza).

Quickstart: Use your own naked and canonical domain names instead of and and customize the Caddyfile and VCL provided in this gist to your preferences!

These instructions target Varnish Cache 4.1, PHP-FPM 7.0, and Caddy 0.10. (I'm using MariaDB 10.1 as well, but that's not relevant to this guide.)

antics / gist:4079584
Created Nov 15, 2012
Login to Wordpress with curl
View gist:4079584
curl -D cookie1.txt
# step 1
# get default cookie of blog and write cookie to cookie1.txt
# step 2
# simulate browser Firefox( of course , you can use any browser agent<!--more--> what you want!) "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070725 Firefox/"
# input your username and also password
# write new cookie to cookie2.txt
curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070725 Firefox/" -D cookie2.txt -b cookie1.txt -F log=username -F pwd=password -F testcookie=1 -F wp-submit="Log In" -F -F submit=login -F rememberme=forever
# currently cookie2.txt stored all cookie info
You can’t perform that action at this time.