<div dir="ltr"><div class="gmail_default" style="font-size:small;color:rgb(51,51,153)">Have a look at the docs:<br><a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass">http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass</a><br></div><div class="gmail_extra"><div><div class="gmail_signature"><font size="1"><span style="color:rgb(102,102,102)">---<br></span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font></div></div>
<br><div class="gmail_quote">On Thu, Sep 17, 2015 at 12:05 PM, mjordan79 <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
I'm trying to set up a reverse proxy (using nginx) for the Spark Web UI.<br>
I have 2 machines:<br>
1) Machine A, with a public IP. This machine will be used to access Spark<br>
Web UI on the Machine B through its private IP address.<br>
2) Machine B, where Spark is installed (standalone master cluster, 1<br>
worker node and the history server) not accessible from the outside.<br>
<br>
Basically I want to access the Spark Web UI through my Machine A using the<br>
URL:<br>
<a href="http://machine_A_ip_address/spark" rel="noreferrer" target="_blank">http://machine_A_ip_address/spark</a><br>
<br>
Currently I have this setup:<br>
http {<br>
proxy_set_header X-Real-IP $remote_addr;<br>
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>
proxy_set_header Host $http_host;<br>
proxy_set_header X-NginX-Proxy true;<br>
proxy_set_header X-Ssl on;<br>
}<br>
<br>
# Master cluster node<br>
upstream app_master {<br>
server machine_B_ip_address:8080;<br>
}<br>
<br>
# Slave worker node<br>
upstream app_worker {<br>
server machine_B_ip_address:8081;<br>
}<br>
<br>
# Job UI<br>
upstream app_ui {<br>
server machine_B_ip_address:4040;<br>
}<br>
<br>
# History server<br>
upstream app_history {<br>
server machine_B_ip_address:18080;<br>
}<br>
<br>
I'm really struggling in figuring out a correct location directive to make<br>
the whole thing work, not only for accessing all ports using the url /spark<br>
but also in making the links in the web app be transformed accordingly.<br>
<br>
Any help really appreciated.<br>
Thank you in advance.<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,261637,261637#msg-261637" rel="noreferrer" target="_blank">http://forum.nginx.org/read.php?2,261637,261637#msg-261637</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div></div>