Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
[Pylon] WebHDFS library compatibility (#2134)
Browse files Browse the repository at this point in the history
* Make /webhdfs/webhdfs alias of /webhdfs/api

* Clear body in 307 response
  • Loading branch information
Gerhut authored Feb 13, 2019
1 parent a5f4eac commit 35b9228
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pylon/src/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,15 @@ http {
location ~ ^/webhdfs/api(.*)$ {
proxy_pass {{WEBHDFS_URI}}/webhdfs$1$is_args$args;
proxy_intercept_errors on;
error_page 307 = @handle_webhdfs_api_redirect;
error_page 307 @handle_webhdfs_api_redirect;
}
location ~ ^/webhdfs/webhdfs {
rewrite ^/webhdfs/webhdfs(.*)$ /webhdfs/api$1 last;
}
location @handle_webhdfs_api_redirect {
if ($upstream_http_location ~ ^http://([^/]+):(\d+)/(.*)$) {
return 307 $scheme://$http_host/a/$1:$2/$3;
add_header Location $scheme://$http_host/a/$1:$2/$3;
return 300 "";
}
}

Expand Down

0 comments on commit 35b9228

Please sign in to comment.