Skip to content

Instantly share code, notes, and snippets.

@shreyaskarnik
Created April 29, 2015 20:27
Show Gist options
  • Save shreyaskarnik/20aaa3a560c10187722e to your computer and use it in GitHub Desktop.
Save shreyaskarnik/20aaa3a560c10187722e to your computer and use it in GitHub Desktop.
nginx-conf
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
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 /dev/stdout main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
upstream docker-registry {
server 0.0.0.0:5000;
}
server {
listen 80;
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
client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
chunked_transfer_encoding on;
location /v2/ {
add_header 'Docker-Distribution-API-Version registry/2.0' always;
proxy_pass http://docker-registry;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
}
}
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment