summaryrefslogtreecommitdiff
path: root/test/integration/targets/setup_docker_registry/files/nginx.conf
blob: bfba52041a9d4601ab8626b03e60e96da5dd2c14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
events {
    worker_connections 16;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    error_log /dev/stdout info;
    access_log /dev/stdout;

    server {
        listen *:5000 ssl;
        server_name test-registry.ansible.com;
        server_name_in_redirect on;

        ssl_protocols TLSv1.2;
        ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256';
        ssl_ecdh_curve X25519:secp521r1:secp384r1;
        ssl_prefer_server_ciphers on;
        ssl_certificate /etc/nginx/cert.pem;
        ssl_certificate_key /etc/nginx/cert.key;

        location / {
            return 401;
        }

        location /v2/ {
            proxy_pass  http://real-registry:5000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $http_host;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Port $server_port;
            proxy_set_header X-Request-Start $msec;

            client_max_body_size 0;
            chunked_transfer_encoding on;

            auth_basic "Ansible Test Docker Registry";
            auth_basic_user_file /etc/nginx/nginx.htpasswd;
        }
    }
}