私は自分のlocalhost上に自分のファイルを置く前に、私はそれらをうまく提供することができました。今、staticfilesをS3に移動しましたが、index.htmlスターターファイルをカスタムドメインで配信したいと考えています。 index.htmlから他の.html
にナビゲートする必要があります。Nginx Proxy S3固有のhtmlファイル
は、これまでのところ、私が得た:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/letsencrypt.conf;
include snippets/ssl-params.conf;
charset utf-8;
server_name mydomain;
location/{
proxy_set_header Host 's3-eu-west-1.amazonaws.com';
proxy_set_header Authorization '';
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header Set-Cookie;
proxy_ignore_headers "Set-Cookie";
proxy_intercept_errors on;
set $indexfile "s3-eu-west-1.amazonaws.com/myprod-bucket/static/js/frontend/build_v0.5/";
proxy_pass https://$indexfile;
# expires 1y;
log_not_found off;
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd_finder;
}
}
私は私が間違って何をやっている、私の場合のために働くすべての例を見つけるように見えることはできません?
UPDATE:私はこのにhttps://stackoverflow.com/a/22843758/977622に基づいてビットを変更し、私は入門:プロキシシナリオコンテンツタイプで
Refused to execute script from '../vendor.5ad3d736.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
と
Resource interpreted as Stylesheet but transferred with MIME type text/html: "../styles/main.b812e04a.css".
あなたの/etc/nginx/mime.types設定の内容は何ですか?また、あなたのロケーションブロックにデフォルトのMIMEタイプを設定することもできます。 – Ellery