ウェブアプリケーションのフロントエンドとしてnginxのコンテナが使用されています。nginx複数の場所とルートの内部
これは私の設定ファイルである:私は、ローカルホストを指している場合
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
root /usr/share/nginx/html/shaka-player-master/demo;
index index.html index.htm;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
:ポートは、それが/usr/share/nginx/html/shaka-player-master/demo/index.html正しく私を返します。.. 。
/usr/share/nginx/html/shaka-player-master/third_party/closure/goog/base.js
/usr/share/nginx/html/shaka-player-master/dist/deps.js
/usr/share/nginx/html/shaka-player-master/shaka-player.uncompiled.js
:
このアプリケーション、ダッシュライブラリは、私がホストされている「deps.js」、base.jsなどをファイル名を生成するPythonスクリプトを実行必要がありますが、私は問題を抱えていますこれらのファイルは、これらのフォルダ内にありますしかし、ブラウザーは404を返します。なぜなら、これらの内容を設定ファイルから公開する方法がわからないからです。
私のようないくつかのコードを追加してみました:
location = third_party/closure/goog/base.js {
root /usr/share/nginx/html/shaka-player-master/third_party/closure/goog/base.js;
}
しかし、まだ404
誰も私を助けることができますか?
これらの3つのファイル - URIは何ですか? 'location'と'ルート '指示文を作成するには、その情報が必要です。 URIをパス名に効果的にマッピングします。 –
GET http:// localhost:9900/third_party/closure/goog/base.jsこれらの3つのリソースに対して、ブラウザは次の要求を行います。 GET http:// localhost:9900/dist/deps.js GET http: //localhost:9900/shaka-player.uncompiled.js – pier92
質問を編集して情報を追加する必要があります。コメントには表示されませんでした –