Merge pull request #790 from Quentin-M/set4O4
Define nginx v2 vhost & properly set 404 status code
This commit is contained in:
commit
da1fe7d48b
2 changed files with 27 additions and 12 deletions
|
@ -63,6 +63,27 @@ location /v1/ {
|
||||||
client_max_body_size 20G;
|
client_max_body_size 20G;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 /v2/ {
|
||||||
|
proxy_buffering off;
|
||||||
|
|
||||||
|
proxy_request_buffering off;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
|
||||||
|
proxy_pass http://registry_app_server;
|
||||||
|
proxy_temp_path /tmp 1 2;
|
||||||
|
|
||||||
|
client_max_body_size 20G;
|
||||||
|
}
|
||||||
|
|
||||||
location /c1/ {
|
location /c1/ {
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
|
|
||||||
|
@ -80,13 +101,6 @@ location /static/ {
|
||||||
error_page 404 /404;
|
error_page 404 /404;
|
||||||
}
|
}
|
||||||
|
|
||||||
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(/?)(.*) {
|
location ~ ^/b1/controller(/?)(.*) {
|
||||||
proxy_pass http://build_manager_controller_server/$2;
|
proxy_pass http://build_manager_controller_server/$2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,11 +58,12 @@ def index(path, **kwargs):
|
||||||
def internal_error_display():
|
def internal_error_display():
|
||||||
return render_page_template('500.html')
|
return render_page_template('500.html')
|
||||||
|
|
||||||
#TODO: reenable once fixed
|
@web.errorhandler(404)
|
||||||
#@web.errorhandler(404)
|
@web.route('/404', methods=['GET'])
|
||||||
#@web.route('/404', methods=['GET'])
|
def not_found_error_display(e = None):
|
||||||
#def not_found_error_display(e = None):
|
resp = render_page_template('404.html')
|
||||||
# return render_page_template('404.html')
|
resp.status_code = 404
|
||||||
|
return resp
|
||||||
|
|
||||||
@web.route('/organization/<path:path>', methods=['GET'])
|
@web.route('/organization/<path:path>', methods=['GET'])
|
||||||
@no_cache
|
@no_cache
|
||||||
|
|
Reference in a new issue