ansible/test/integration/targets/setup_docker_registry/files/nginx.conf
Matt Clay 567c860027
Split up docker-registry test target. (#65211)
* Copy relevant docker-registry files:

docker-registry/files/nginx.conf -> setup_docker_registry/files/nginx.conf
docker-registry/files/nginx.htpasswd -> setup_docker_registry/files/nginx.htpasswd
docker-registry/meta/main.yml -> setup_docker_registry/meta/main.yml
docker-registry/tasks/main.yml -> setup_docker_registry/tasks/main.yml
docker-registry/tasks/main.yml -> setup_docker_registry/handlers/cleanup.yml

* Remove non-cleanup code from handlers/cleanup.yml.

* Remove tests and cleanup from tasks/main.yml.

* Register cleanup handler.

* Use setup_docker_registry in docker-registry test.

* Fix handler execution order.

* Split out docker_login integration test.

* Move remaining tests into docker_image test.

* Cleanup before running docker_image options test.

* Improve reliability of test cleanup.

* Move files for conditional inclusion.

* Set proper conditions on tests.

* Rename tasks file for conditional inclusion.

* Conditionally include tasks.
2019-12-04 14:14:43 -08:00

46 lines
1.6 KiB
Nginx Configuration File

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;
}
}
}