Skip to content

Instantly share code, notes, and snippets.

@DarthSim
Created May 20, 2019 12:25
Show Gist options
  • Save DarthSim/a5ad15ba399eb9166cef546eb2d31278 to your computer and use it in GitHub Desktop.
Save DarthSim/a5ad15ba399eb9166cef546eb2d31278 to your computer and use it in GitHub Desktop.
imgproxy + nginx
server {
listen 443 default_server ssl;
listen [::]:443 default_server ssl;
client_max_body_size 32M;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/key.pem;
keepalive_timeout 60;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers on;
location / {
proxy_pass "http://127.0.0.1:8080";
proxy_redirect off;
}
}
FROM darthsim/imgproxy:latest
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk --no-cache upgrade \
&& apk add --no-cache nginx
RUN echo -e "#!/bin/bash\nnginx && imgproxy" > /usr/local/bin/imgproxy-nginx
RUN chmod +x /usr/local/bin/imgproxy-nginx
RUN mkdir -p /run/nginx
ADD default.conf /etc/nginx/conf.d/default.conf
ADD cert.pem /etc/nginx/ssl/cert.pem
ADD key.pem /etc/nginx/ssl/key.pem
CMD ["/usr/local/bin/imgproxy-nginx"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment