2015-01-13 15:19:42 -05:00
|
|
|
# vim: ft=nginx
|
|
|
|
|
2014-01-31 18:13:46 -05:00
|
|
|
server_name _;
|
|
|
|
|
|
|
|
keepalive_timeout 5;
|
|
|
|
|
2015-10-07 11:17:07 -04:00
|
|
|
if ($host = "www.quay.io") {
|
2016-02-03 13:08:43 -05:00
|
|
|
return 301 $proper_scheme://quay.io$request_uri;
|
2015-10-07 11:17:07 -04:00
|
|
|
}
|
|
|
|
|
2015-05-22 16:25:28 -04:00
|
|
|
# Disable the ability to be embedded into iframes
|
2015-05-22 13:54:43 -04:00
|
|
|
add_header X-Frame-Options DENY;
|
|
|
|
|
|
|
|
|
|
|
|
# Proxy Headers
|
2015-02-19 16:24:05 -05:00
|
|
|
proxy_set_header X-Forwarded-For $proper_forwarded_for;
|
2016-02-03 13:08:43 -05:00
|
|
|
proxy_set_header X-Forwarded-Proto $proper_scheme;
|
2015-11-18 15:53:52 -05:00
|
|
|
proxy_set_header Host $host;
|
2015-01-21 15:59:29 -05:00
|
|
|
proxy_redirect off;
|
2014-10-14 13:58:08 -04:00
|
|
|
|
2015-01-21 15:59:29 -05:00
|
|
|
proxy_set_header Transfer-Encoding $http_transfer_encoding;
|
2014-10-14 13:58:08 -04:00
|
|
|
|
2014-01-31 18:13:46 -05:00
|
|
|
location / {
|
2014-10-14 13:58:08 -04:00
|
|
|
proxy_pass http://web_app_server;
|
|
|
|
}
|
|
|
|
|
2014-10-17 15:50:40 -04:00
|
|
|
location /realtime {
|
|
|
|
proxy_pass http://web_app_server;
|
|
|
|
proxy_buffering off;
|
2014-11-24 16:07:38 -05:00
|
|
|
proxy_request_buffering off;
|
2014-10-17 15:50:40 -04:00
|
|
|
}
|
|
|
|
|
2016-08-24 12:55:33 -04:00
|
|
|
location ~ ^/_storage_proxy/([^/]+)/([^/]+)/([^/]+)/(.+) {
|
2016-09-19 16:06:19 -04:00
|
|
|
include resolver.conf;
|
2016-08-24 12:55:33 -04:00
|
|
|
|
2016-09-19 16:06:19 -04:00
|
|
|
auth_request /_storage_proxy_auth;
|
2016-08-24 12:55:33 -04:00
|
|
|
|
|
|
|
proxy_pass $2://$3/$4$is_args$args;
|
|
|
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $3;
|
|
|
|
|
|
|
|
add_header Host $3;
|
|
|
|
|
|
|
|
proxy_buffering off;
|
|
|
|
proxy_request_buffering off;
|
|
|
|
|
|
|
|
proxy_read_timeout 60s;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
location = /_storage_proxy_auth {
|
|
|
|
proxy_pass http://web_app_server;
|
|
|
|
proxy_pass_request_body off;
|
|
|
|
proxy_set_header Content-Length "";
|
|
|
|
|
|
|
|
proxy_set_header X-Original-URI $request_uri;
|
|
|
|
|
|
|
|
proxy_read_timeout 10;
|
|
|
|
}
|
|
|
|
|
2015-08-25 14:18:34 -04:00
|
|
|
# At the begining and end of a push/pull, (/v1/repositories|/v2/auth/) is hit by the Docker
|
2015-02-25 12:32:48 -05:00
|
|
|
# client. By rate-limiting just this endpoint, we can avoid accidentally
|
|
|
|
# blocking pulls/pushes for images with many layers.
|
2015-08-25 14:18:34 -04:00
|
|
|
location ~ ^/(v1/repositories|v2/auth)/ {
|
2015-02-19 16:24:05 -05:00
|
|
|
proxy_buffering off;
|
|
|
|
|
|
|
|
proxy_request_buffering off;
|
|
|
|
|
|
|
|
proxy_pass http://registry_app_server;
|
|
|
|
proxy_read_timeout 2000;
|
2015-03-26 09:21:45 -04:00
|
|
|
proxy_temp_path /tmp 1 2;
|
2015-02-19 16:24:05 -05:00
|
|
|
|
2015-02-25 12:22:41 -05:00
|
|
|
limit_req zone=repositories burst=10;
|
2015-02-19 16:24:05 -05:00
|
|
|
}
|
|
|
|
|
2016-04-18 12:56:03 -05:00
|
|
|
location /secscan/ {
|
2016-04-21 11:40:16 -05:00
|
|
|
proxy_pass http://jwtproxy_secscan;
|
2016-04-18 11:42:17 -05:00
|
|
|
}
|
|
|
|
|
2017-02-13 14:14:44 -05:00
|
|
|
{% if signing_enabled %}
|
|
|
|
location ~ ^/v2/(.+)/_trust/tuf/(.*)$ {
|
2017-02-14 18:09:56 -05:00
|
|
|
set $upstream_tuf {{ tuf_server }};
|
|
|
|
proxy_pass $upstream_tuf$uri;
|
2017-02-23 19:02:05 -05:00
|
|
|
proxy_set_header Host "{{ tuf_host }}";
|
2017-02-13 14:14:44 -05:00
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
|
2017-03-23 13:06:22 -04:00
|
|
|
location ~ ^/cnr {
|
|
|
|
proxy_buffering off;
|
|
|
|
|
|
|
|
proxy_request_buffering off;
|
|
|
|
|
|
|
|
proxy_pass http://registry_app_server;
|
|
|
|
proxy_read_timeout 120;
|
|
|
|
proxy_temp_path /tmp 1 2;
|
|
|
|
|
|
|
|
limit_req zone=repositories burst=10;
|
|
|
|
}
|
|
|
|
|
2015-11-24 17:02:09 -05:00
|
|
|
location ~ ^/v2 {
|
|
|
|
# If we're being accessed via v1.quay.io, pretend we don't support v2.
|
|
|
|
if ($host = "v1.quay.io") {
|
|
|
|
return 404;
|
|
|
|
}
|
|
|
|
|
2017-05-03 18:27:45 -04:00
|
|
|
if ($request_method = HEAD ) {
|
|
|
|
gzip off;
|
|
|
|
}
|
|
|
|
|
2015-11-24 17:02:09 -05:00
|
|
|
# Setting ANY header clears all inherited proxy_set_header directives
|
|
|
|
proxy_set_header X-Forwarded-For $proper_forwarded_for;
|
2016-02-03 13:08:43 -05:00
|
|
|
proxy_set_header X-Forwarded-Proto $proper_scheme;
|
2015-11-24 17:02:09 -05:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
|
|
|
proxy_buffering off;
|
|
|
|
|
|
|
|
proxy_request_buffering off;
|
|
|
|
|
2016-04-19 17:52:54 -04:00
|
|
|
proxy_read_timeout 2000;
|
2015-12-03 11:19:39 -05:00
|
|
|
|
2015-11-24 17:02:09 -05:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
|
|
|
proxy_pass http://registry_app_server;
|
|
|
|
proxy_temp_path /tmp 1 2;
|
|
|
|
|
2017-02-27 13:03:20 -05:00
|
|
|
client_max_body_size {{ maximum_layer_size }};
|
2015-11-24 17:02:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
location ~ ^/v1 {
|
2015-11-18 17:23:30 -05:00
|
|
|
# Setting ANY header clears all inherited proxy_set_header directives
|
|
|
|
proxy_set_header X-Forwarded-For $proper_forwarded_for;
|
2016-02-03 13:08:43 -05:00
|
|
|
proxy_set_header X-Forwarded-Proto $proper_scheme;
|
2015-11-18 17:23:30 -05:00
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
2014-10-14 13:58:08 -04:00
|
|
|
proxy_buffering off;
|
|
|
|
|
|
|
|
proxy_request_buffering off;
|
|
|
|
|
2015-06-04 14:31:08 -04:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
2014-10-14 13:58:08 -04:00
|
|
|
proxy_pass http://registry_app_server;
|
2015-03-26 09:21:45 -04:00
|
|
|
proxy_temp_path /tmp 1 2;
|
2014-10-14 13:58:08 -04:00
|
|
|
|
2017-02-27 13:03:20 -05:00
|
|
|
client_max_body_size {{ maximum_layer_size }};
|
2014-10-14 13:58:08 -04:00
|
|
|
}
|
|
|
|
|
2015-11-04 14:56:18 -05:00
|
|
|
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';
|
|
|
|
}
|
|
|
|
|
2014-10-14 13:58:08 -04:00
|
|
|
location /c1/ {
|
2014-01-31 18:13:46 -05:00
|
|
|
proxy_buffering off;
|
|
|
|
|
|
|
|
proxy_request_buffering off;
|
|
|
|
|
2014-10-14 13:58:08 -04:00
|
|
|
proxy_pass http://verbs_app_server;
|
2015-03-26 09:21:45 -04:00
|
|
|
proxy_temp_path /tmp 1 2;
|
2015-02-19 16:24:05 -05:00
|
|
|
|
2015-02-25 12:32:30 -05:00
|
|
|
limit_req zone=verbs burst=10;
|
2014-10-02 16:04:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
location /static/ {
|
|
|
|
# checks for static file, if not found proxy to app
|
2017-02-02 00:17:25 +01:00
|
|
|
alias {{static_dir}};
|
2015-10-21 15:28:45 -04:00
|
|
|
error_page 404 /404;
|
2014-11-24 16:07:38 -05:00
|
|
|
}
|
2014-11-25 18:08:18 -05:00
|
|
|
|
2017-02-02 00:17:25 +01:00
|
|
|
error_page 502 {{static_dir}}/502.html;
|
2016-02-01 15:07:50 +02:00
|
|
|
|
2014-11-25 18:08:18 -05:00
|
|
|
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";
|
2016-11-01 16:07:17 -04:00
|
|
|
proxy_read_timeout 300;
|
2014-12-01 12:48:59 -05:00
|
|
|
}
|