我试图将我的容器化ASP.NET CORE应用程序部署到Azure AppService,该应用程序仅允许HTTPS连接。
app.UseHttpsRedirection();
无论我尝试什么,我总是得到
的回应ERR_TOO_MANY_REDIRECTS
我试图对环境变量做一些事情,在Dockerfile或端口映射中公开
我的Dockerfile的一部分:
EXPOSE 80
EXPOSE 443
EXPOSE 5000
EXPOSE 5001
launchSettings.json:
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger"
},
"Program": {
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:5001;http://localhost:5000"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger"
}
Azure自动生成的运行命令:
docker run -d -p 44715:80 --name <container_name>_0 -e DOCKER_CUSTOM_IMAGE_NAME=docker.io/<repo>/<repo>:<tag> -e WEBSITE_SITE_NAME=<website> -e WEBSITE_AUTH_ENABLED=False -e PORT=80 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_INSTANCE_ID=<id>-e HTTP_LOGGING_ENABLED=1 docker.io/<repo>/<repo>:<tag>
Azure Docker日志:
Hosting environment: Production
Content root path: /app
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.