我有一个基于s3的静态网站,其形式为:
的http://.s3-website-us-east-1.amazonaws.com/
我还拥有一个完全独立的(非AWS)域名www..com,我要做的是设置一个CNAME记录,以便http://..com可以工作。
我尝试了很多CNAME记录,例如:
public void ConfigureServices(IServiceCollection services)
{
services.Configure<MvcOptions>(options =>
{
options.Filters.Add(new CorsAuthorizationFilterFactory("AllowSpecificOrigin"));
});
services.AddCors(options =>
{
options.AddPolicy("AllowSpecificOrigin",
builder => builder.WithOrigins("http://localhost:5000").AllowAnyHeader()
.AllowAnyMethod());
});
services.AddMvc()
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
loggerFactory.AddConsole();
loggerFactory.AddDebug(LogLevel.Information);
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
// Shows UseCors with named policy.
app.UseCors("AllowSpecificOrigin");
app.UseStaticFiles();
app.UseAuthentication();
app.UseMvcWithDefaultRoute();
}
}
我看到的是我收到AWS错误,说没有这样的存储桶 - BucketName:..
我无法找到正确的语法(并且考虑到TTL试验和错误很难)。有什么提示吗?