在win10 用docker搭建 postgresql 和 dotnet core 3.1环境
//查询 image
docker search Debian
// 拉取 image debian
docker pull debian
win10 home下 安装了PgAdmin启动了,但是浏览器不能进入管理界面的问题:
浏览器错误内容:Refused to execute script from 'xxxxxxxxxx' because its MIME type ('text/html') is not executable
- 在Pgadmin安装目录web下找到找到 config.py文件,修改内容
# The X-Content-Type-Options header forces the browser to honor the response # content type instead of trying to detect it, which can be abused to # generate a cross-site scripting (XSS) attack. # e.g. nosniff # X_CONTENT_TYPE_OPTIONS = "nosniff" X_CONTENT_TYPE_OPTIONS = "" # The browser will try to prevent reflected XSS attacks by not loading the # page if the request contains something that looks like JavaScript and the # response contains the same data. e.g. '1; mode=block' # X_XSS_PROTECTION = "1; mode=block" X_XSS_PROTECTION = "0; mode=block"
dotnet core 运行改变地址和端口:
public class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseUrls("http://0.0.0.0:5000"); webBuilder.UseStartup<Startup>(); }); }

浙公网安备 33010602011771号