Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
proxy_set_header Host $http_host; # required for docker client's sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP
proxy_set_header Authorization "";
proxy_read_timeout 900;
# For going into conf.d/
server {
listen 80;
client_max_body_size 0;
chunked_transfer_encoding on;
location / {
auth_basic "Restricted";
auth_basic_user_file conf.d/htpasswd;
add_header Docker-Distribution-Api-Version registry/2.0 always;
# We'll auto generate this file
include /docker-registry.conf;
cp /etc/nginx/conf.d/docker-registry.tmpl /docker-registry.conf
[ -z "${REGISTRY_PORT_5000_TCP_ADDR}" ] && echo "\$REGISTRY_PORT_5000_TCP_ADDR is not set" || sed -i "s/REGISTRY_PORT_5000_TCP_ADDR/${REGISTRY_PORT_5000_TCP_ADDR}/" /docker-registry.conf
[ -z "${REGISTRY_PORT_5000_TCP_PORT}" ] && echo "\$REGISTRY_PORT_5000_TCP_PORT is not set" || sed -i "s/REGISTRY_PORT_5000_TCP_PORT/${REGISTRY_PORT_5000_TCP_PORT}/" /docker-registry.conf
/usr/sbin/nginx -g "daemon off;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.