2016-05-20 11 views
1

nginxでconfigure spark web-uiが必要です。nginxでSpark Web-UIを設定する

マイ設定

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; 
} 

しかし、私がURLにアクセスしようとすると、画像やCSSは(404が見つからない)にロードされていません。

私のリモートマシン(192.168.230.45)の静的フォルダにimagesとcssファイルがあると仮定しますが、urlは自分のnginxがインストールされているマシンの静的フォルダを指しています。

http://localhost/static/img1.png

代わり

http://192.168.230.45/static/img1.png

答えて

1

私は解決のために数日を失ってしまいました。最後に、この問題を解決する方法を見つけました。

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; 
} 

またあなたが「歴史」様のリンクとそこに同様の問題に直面します: は、ここに私たちの問題の私の解像度です。 解決方法は同じです。次の行を追加してください:

sub_filter "/history/" "/app/spark/master/history/"; 

そしてvoila!

0

私も同じ問題を抱えていた、あなたはルートとしてそれを使用する必要があります。

app/spark/master =>/
location/{ 
      proxy_pass http://192.168.230.45:8080; 
      auth_basic "Restricted Content"; 
      auth_basic_user_file /etc/nginx/pwds; 
} 

またはパターン補正を設定する必要があります。

rewrite ^/(.*) https://$server_name/$1 permanent;