Hi,
I have a few dotnet core web applications running outside of azure (other service provider) within docker containers. My question is that is it possible to add a custom domain mapping to those containers with https support in Azure Front Door Service? I'm trying to do this for few days now without any success. I mapped the domain to Front Door, the http connection is working but when I try the https I get this error: Our services aren't available right now. It does not reach my host at all. I tried with Azure Managed SSL and with my own certificate too.
Thank you for your help!
Best Regards,
Gery
Startup.cs
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseWebAssemblyDebugging(); } else { app.UseExceptionHandler("/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseBlazorFrameworkFiles(); app.UseStaticFiles(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapFallbackToFile("index.html"); }); }
Dockerfile
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base WORKDIR /app EXPOSE 80 EXPOSE 443 FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build WORKDIR /src COPY ["FrontDoorTest3/Server/FrontDoorTest3.Server.csproj", "FrontDoorTest3/Server/"] COPY ["FrontDoorTest3/Shared/FrontDoorTest3.Shared.csproj", "FrontDoorTest3/Shared/"] COPY ["FrontDoorTest3/Client/FrontDoorTest3.Client.csproj", "FrontDoorTest3/Client/"] RUN dotnet restore "FrontDoorTest3/Server/FrontDoorTest3.Server.csproj" COPY . . WORKDIR "/src/FrontDoorTest3/Server" RUN dotnet build "FrontDoorTest3.Server.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "FrontDoorTest3.Server.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "FrontDoorTest3.Server.dll"]
docker-compose.yml
version: "3" services: web: image: <azure-container-registry>/frontdoortest3server:latest ports: - "8500:80" environment: - ASPNETCORE_ENVIRONMENT=Production - ASPNETCORE_URLS=http://+:80
I also tried with an nginx proxy routing the traffic to the web app container, only the http worked.