Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.90 KB | None | 0 0
  1.   server {
  2.     listen 443 ssl;
  3.     #listen 80; #for certs renew
  4.     server_name registry.dev.geen.io;
  5.  
  6.  
  7.  
  8.  
  9.     ssl_certificate /etc/letsencrypt/live/registry.dev.geen.io/fullchain.pem;
  10.     ssl_certificate_key /etc/letsencrypt/live/registry.dev.geen.io/privkey.pem;
  11.  
  12.  
  13.     ssl_protocols TLSv1.1 TLSv1.2;
  14.     ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  15.     ssl_prefer_server_ciphers on;
  16.     ssl_session_cache shared:SSL:10m;
  17.  
  18.     # disable any limits to avoid HTTP 413 for large image uploads
  19.     client_max_body_size 0;
  20.  
  21.     # required to avoid HTTP 411: see Issue #1486 (https://github.com/docker/docker/issues/1486)
  22.     chunked_transfer_encoding on;
  23.  
  24.     location '/.well-known/acme-challenge/' {
  25.         default_type "text/plain";
  26.         root        /tmp/letsencrypt-auto;
  27.     }
  28.  
  29.     location /v2/ {
  30.       # Do not allow connections from docker 1.5 and earlier
  31.       # docker pre-1.6.0 did not properly set the user agent on ping, catch "Go *" user agents
  32.       if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
  33.         return 404;
  34.       }
  35.  
  36.       # To add basic authentication to v2 use auth_basic setting.
  37.       auth_basic "Registry realm";
  38.       auth_basic_user_file /etc/nginx/.htpasswd;
  39.  
  40.       ## If $docker_distribution_api_version is empty, the header will not be added.
  41.       ## See the map directive above where this variable is defined.
  42.       add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always;
  43.  
  44.       proxy_pass                          http://docker-registry;
  45.       proxy_set_header  Host              $http_host;   # required for docker client's sake
  46.       proxy_set_header  X-Real-IP         $remote_addr; # pass on real client's IP
  47.       proxy_set_header  X-Forwarded-For   $proxy_add_x_forwarded_for;
  48.       proxy_set_header  X-Forwarded-Proto $scheme;
  49.       proxy_read_timeout                  900;
  50.     }
  51.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement