# vim: ft=nginx server_name _; keepalive_timeout 5; if ($args ~ "_escaped_fragment_") { rewrite ^ /snapshot$uri; } # SSL ssl_certificate ./stack/ssl.cert; ssl_certificate_key ./stack/ssl.key; ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_session_cache shared:SSL:10m; ssl_session_timeout 5m; ssl_stapling on; ssl_stapling_verify on; ssl_prefer_server_ciphers on; add_header X-Frame-Options DENY; # Proxy Headers proxy_set_header X-Forwarded-For $proper_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header Transfer-Encoding $http_transfer_encoding; location / { proxy_pass http://web_app_server; } location /realtime { proxy_pass http://web_app_server; proxy_buffering off; proxy_request_buffering off; } # At the begining and end of a push/pull, /v1/repositories is hit by the Docker # client. By rate-limiting just this endpoint, we can avoid accidentally # blocking pulls/pushes for images with many layers. location /v1/repositories/ { proxy_buffering off; proxy_request_buffering off; proxy_pass http://registry_app_server; proxy_read_timeout 2000; proxy_temp_path /tmp 1 2; limit_req zone=repositories burst=10; } location /v1/ { proxy_buffering off; proxy_request_buffering off; proxy_pass http://registry_app_server; proxy_temp_path /tmp 1 2; client_max_body_size 20G; } location /c1/ { proxy_buffering off; proxy_request_buffering off; proxy_pass http://verbs_app_server; proxy_temp_path /tmp 1 2; limit_req zone=verbs burst=10; } location /static/ { # checks for static file, if not found proxy to app alias /static/; } location /v1/_ping { add_header Content-Type text/plain; add_header X-Docker-Registry-Version 0.6.0; add_header X-Docker-Registry-Standalone 0; return 200 'true'; } location ~ ^/b1/controller(/?)(.*) { proxy_pass http://build_manager_controller_server/$2; } location ~ ^/b1/socket(/?)(.*) { proxy_pass http://build_manager_websocket_server/$2; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }