Skip to content

Instantly share code, notes, and snippets.

View chrismeller's full-sized avatar

Chris Meller chrismeller

View GitHub Profile
@chrismeller
chrismeller / gist:4748175
Last active December 12, 2015 08:59
http vhost
server {
# we want to listen on port 80 on all IPs on our system - both IPv4 and IPv6
listen [::]:80;
# our primary server name is the first, aliases simply come after it. you can also include wildcards like *.example.com
server_name blog.chrismeller.com new.chrismeller.com;
# where are our site files stored?
root /media/www/public_html/blog.chrismeller.com/public;
# define our access and error logs for this vhost
@chrismeller
chrismeller / gist:4748101
Created February 10, 2013 02:35
uploads.conf
client_max_body_size 32m;
@chrismeller
chrismeller / gist:4748080
Created February 10, 2013 02:28
Nginx php-fpm.conf
upstream php {
server unix:/var/run/php5-fpm.socket;
}
# make sure index.php is first in all our vhosts
index index.php index.html index.htm;
@chrismeller
chrismeller / gist:4748033
Last active December 12, 2015 08:59
ssl.conf
# we want to enable ssl session resumption to avoid
# having to start the handshake from scratch each page load
# so first we enable a shared cache, named SSL (creative!) that is 10mb large
ssl_session_cache shared:SSL:10m;
# save things in the cache for 3 minutes
# if you're not making a request at least every 3 minutes, this isn't going
# to accomplish anything anyway
ssl_session_timeout 3m;
@chrismeller
chrismeller / gist:4747869
Last active December 12, 2015 08:59
gzip.conf
# most people include something like this. don't.
# check your default nginx.conf, it's already covered in a much better way.
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
# compress proxied requests too.
# it doesn't actually matter if the request is proxied, we still want it compressed.
gzip_proxied any;
# a pretty comprehensive list of content mime types that we want to compress
# there's a lot of repetition here because different applications might use different
@chrismeller
chrismeller / gist:4747589
Created February 9, 2013 23:34
expires.conf
expires max;
@chrismeller
chrismeller / gist:4747214
Created February 9, 2013 21:37
charset.conf
charset utf-8;
@chrismeller
chrismeller / gist:4747105
Created February 9, 2013 21:02
status.conf
[www]
pm.status_path = /status
@chrismeller
chrismeller / gist:4747102
Created February 9, 2013 21:02
socket.conf
[www]
listen = /var/run/php5-fpm.socket
@chrismeller
chrismeller / gist:4747097
Last active December 12, 2015 08:49
processes.conf
[www]
; at any time, there can be no more than 5 child processes
; if you know how much memory each process consumes regularly
; and how much free memory you have on your system, this is how
; you set a "hard limit" on the amount of memory php-fpm will be able to consume
pm.max_children = 5
; when php-fpm first starts, how many processes should
; it immediately generate to handle requests?
; when you restart php-fpm, there may be an influx of requests.