Public | Automated Build

Last pushed: 7 months ago
Short Description
varnish_nginx
Full Description

Create Docker container:
docker run -d -p 80:80 -p 443:443 -v <your local config directory>:/home --name varnish_nginx local/varnish_nginx

Needed files for the config directory:
nginx.conf; varnish.vcl; <CERT-FILE>.cert.pem; <KEY-FILE>.key.pem

#########################
varnish.vcl

#########################
vcl 4.0;
backend default {
.host = "127.0.0.1";
.port = "80";
}
sub vcl_recv {
}
sub vcl_backend_response {
}
sub vcl_deliver {
}

#########################
nginx.conf

#########################
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
server {
listen 443 ssl;
server_name <SERVER NAME>;
ssl_certificate /home/<CERT-FILE>.cert.pem;
ssl_certificate_key /home/<KEY-FILE>.key.pem;
location / {
proxy_pass http://127.0.0.1:80;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Port 443;
proxy_set_header Host $host;
}
}
}

Docker Pull Command
Owner
s3bastian89
Source Repository

Comments (0)