86 lines
2.4 KiB
Nginx Configuration File
86 lines
2.4 KiB
Nginx Configuration File
error_log /dev/stdout info;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
keepalive_timeout 65;
|
|
types_hash_max_size 2048;
|
|
server_tokens off;
|
|
default_type application/octet-stream;
|
|
|
|
upstream docker-registry {
|
|
server docker-registry:5000;
|
|
}
|
|
|
|
upstream docker-frontend {
|
|
server docker-frontend:80;
|
|
}
|
|
|
|
map $upstream_http_docker_distribution_api_version $docker_distribution_api_version {
|
|
'' 'registry/2.0';
|
|
}
|
|
|
|
ldap_server ldap {
|
|
url ldap://ldap.proxy/dc=karinthy,dc=hu?uid?sub?(objectClass=posixAccount);
|
|
group_attribute memberUid;
|
|
group_attribute_is_dn off;
|
|
require group "cn=ciuser,ou=Groups,dc=karinthy,dc=hu"
|
|
require valid_user;
|
|
}
|
|
|
|
auth_ldap_cache_enabled on;
|
|
auth_ldap_cache_expiration_time 10;
|
|
auth_ldap_cache_size 512;
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name registry.karinthy.hu;
|
|
|
|
ssl_certificate /etc/nginx/ssl/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
|
|
|
|
ssl_protocols TLSv1.1 TLSv1.2;
|
|
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!PSK:!EXPORT:!RC4:!MD5:!DES:!ADK:!CAMELLIA';
|
|
ssl_prefer_server_ciphers on;
|
|
ssl_session_cache shared:SSL:10m;
|
|
|
|
client_max_body_size 0;
|
|
chunked_transfer_encoding on;
|
|
|
|
location / {
|
|
auth_ldap "Karinthy Docker Registry";
|
|
auth_ldap_servers ldap;
|
|
|
|
proxy_pass http://docker-frontend;
|
|
proxy_set_header Host $http_host;
|
|
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 $scheme;
|
|
proxy_read_timeout 900;
|
|
}
|
|
|
|
location /v2 {
|
|
if ($http_user_agent ~ "^(docker\/1\.(3|4|5(?!\.[0-9]-dev))|Go ).*$" ) {
|
|
return 404;
|
|
}
|
|
|
|
add_header 'Docker-Distribution-Api-Version' $docker_distribution_api_version always;
|
|
|
|
auth_ldap "Karinthy Docker Registry";
|
|
auth_ldap_servers ldap;
|
|
|
|
proxy_pass http://docker-registry;
|
|
proxy_set_header Host $http_host;
|
|
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 $scheme;
|
|
proxy_read_timeout 900;
|
|
}
|
|
}
|
|
}
|