Q:

Configuring Spark Web-UI with nginx

I need configure spark web-ui with nginx . 
My configuration
 location /app/spark/master {
            proxy_pass http://192.168.230.45:8080/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 }

but when i try to access the url, the images and css are not loaded(404 not found). 
Now assume the images and css files in static folder of my remote machine(192.168.230.45) but the url points to static folder of my nginx installed machine.  

http://localhost/static/img1.png

instead 

http://192.168.230.45/static/img1.png

A:

I've lost a couple of days being looking for solution. Finally I've found out how to resolve this problem. 
Here is my resolution of our issue:
location /app/spark/master/ {
        proxy_pass http://192.168.230.45:8080/;
        proxy_set_header Accept-Encoding "";
        sub_filter "/static/" "/app/spark/master/static/";
        sub_filter_once off;
}

In addition You'll face there similar problem with "history"-like links.
Solution will be the same. Just add the line:
sub_filter "/history/" "/app/spark/master/history/";

And voila!

