.NETCore Kestrel HTTPs 502 Bad Gateway nginx with port forwarding #7116
Replies: 5 comments 13 replies
-
I mentioned this in another location you logged this, but try this using VS Code client instead of the web. I don't believe that web port forwarding would support a custom SSL certificate (unless @derekbekoe or @lostintangent correct me). When using VS Code client, on your local machine this would be mapped to localhost as a straight TCP port and would then work. You would also have to configure your local browser with the SSL certificate since dotnet new generates a custom one. Generally a better approach is to create one locally and copy it into a Codespace instead (e.g. as described at https://github.com/microsoft/vscode-dev-containers/tree/main/containers/dotnet#enabling-https-in-aspnet) EDIT: While forwarding a custom cert is not supported, the web URI should switch from the custom cert to a codespaces one if the port is set in |
Beta Was this translation helpful? Give feedback.
-
Hi @Chuxel /cc @lostintangent & @derekbekoe Potential bug ?With the exception that the 5001 port in the ports pane from Codespaces in VSCode is mapped to http and not https. In the Ports panel from Codespaces VSCode extension that lists out the ports, the privacy and process etc, I have then tried to set the port 5001 to use HTTPS Port Protocol, but instead this seems to use the Browsing to it directly with CTRL + Click from the terminal from the output of dotnet run command works with no issues as long as you have not changed the Port protocol from the ports pane. QuestionsWith me doing the steps for the development SSL certificate from my machine into the Codespace. If any colleagues, team mates or anyone else who would fork or work on this repo. Would the certificate work for them without issues or does each new person working on the repository need to repeat these steps? I am planning on creating a GitHub Repository template, with the goal for someone to have a specific .NETCore project ready for them to go and work with direct in GitHub Codespaces. How could I automate the SSL certificate export so its one less step for people to worry about to get up and running. Are there any plans to support the Do you know if anyone in the .NETCore team has tried to use some of the dotnet new web templates in Codespaces? Look forward to making Codespaces a super great place to build and work with .NETCore WebApp development |
Beta Was this translation helpful? Give feedback.
-
We were able to get ours to load after
Then it came up |
Beta Was this translation helpful? Give feedback.
-
Delete this line if you are using .net core 6. it has worked for me |
Beta Was this translation helpful? Give feedback.
-
I was working on this project on Codespaces and got the same error: https://github.com/LinkedInLearning/hands-on-aspnet-razor-pages-3084715 Commenting this line number 16 helped solve the issue. |
Beta Was this translation helpful? Give feedback.
-
Summary
Unable to browse to a dotnet new WebApp template on HTTPs 5001 port. A 502 Bad Gateway error is shown from nginx
Terminal Output
Steps to Reproduce:
dotnet new webapp --name Testing
cd Testing
and thendotnet restore
dotnet build
anddotnet run
dotnet dev-certs https --trust
dotnet-run
Beta Was this translation helpful? Give feedback.
All reactions