Skip to content

Instantly share code, notes, and snippets.

@h0lyalg0rithm
Last active August 29, 2015 14:10
Show Gist options
  • Save h0lyalg0rithm/17362c3924d735afbce1 to your computer and use it in GitHub Desktop.
Save h0lyalg0rithm/17362c3924d735afbce1 to your computer and use it in GitHub Desktop.
resolver 172.16.0.23 valid=300s;
resolver_timeout 10s;
proxy_cache_path /tmp/cache levels=1:2 keys_zone=S3CACHE:10m inactive=48h max_size=1000m;
proxy_temp_path /tmp/cache/temp;
server {
listen 80;
server_name localhost;
location / {
try_files $uri @s3cache;
}
location @s3cache{
proxy_cache S3CACHE;
proxy_cache_valid 200 48h;
proxy_cache_valid 403 60m;
proxy_pass http://<bucket>.s3.amazonaws.com;
}
}
FROM nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
global
log 127.0.0.1 local0 notice
maxconn 2000
user haproxy
group haproxy
listen appname 0.0.0.0:80
mode http
stats enable
cookie SRVNAME insert
balance source
option httpclose
option forwardfor
server server1 <server ip>:80 check
server server2 <server ip>:80 check
listen stats 0.0.0.0:8080
mode http
log global
stats enable
stats auth admin:password
stats uri /haproxy?stats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment