由于部署的机器网络限制,需要使用Nginx设置代理.
开始想的 比较简单,常规设置conf/nginx.conf
#nifi prod
upstream nificluster{
server hdfmaster:9090;
}
server {
listen 7077;
server_name nginxhost;
.................
}
location /nifi/ {
proxy_pass http://nificluster/nifi/;
}
location /nifi-api/ {
proxy_pass http://nificluster/nifi-api/;
}
location /nifi-content-viewer/ {
proxy_pass http://nificluster/nifi-content-viewer/;
}
属性页面不能使用,查了一下文档,添加一些属性就可以了,http://nginxhost:7077/nifi/
Hortonworks DataFlow Administration:1.1.12. Proxy Configuration
location /nifi/ {
proxy_pass http://nificluster/nifi/;
proxy_set_header X-ProxyScheme http;
proxy_set_header X-ProxyHost nginxhost;
proxy_set_header X-ProxyPort 7077;
proxy_set_header X-ProxyContextPath /;
}
location /nifi-api/ {
proxy_pass http://nificluster/nifi-api/;
proxy_set_header X-ProxyScheme http;
proxy_set_header X-ProxyHost nginxhost;
proxy_set_header X-ProxyPort 7077;
proxy_set_header X-ProxyContextPath /;
}
location /nifi-content-viewer/ {
proxy_pass http://nificluster/nifi-content-viewer/;
proxy_set_header X-ProxyScheme http;
proxy_set_header X-ProxyHost nginxhost;
proxy_set_header X-ProxyPort 7077;
proxy_set_header X-ProxyContextPath /;
}