I am working on asp.net MVC project in Visual Studio 2022 community version and published it on a server it works fine with the URL http://localhost:8080/myoroject locally but when a client device tries to access the project via server IP http://192...*:8080/myproject client gets This site cannot provide a secure connection <192...*> sent an invalid response. error and all CSS & Js resources respond with Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR
I don't know why the initial HTTP request is redirected to HTTPs request
I am expectation for the client device to access the project via an IP address of the server and get a response but currently, the system is redirecting them to HTTPs instead of the initial HTTP request
I finally solved the issue, it was a meta tag from the project layout <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
located in Views/Shared/_Layout.chtml
that was forcing HTTP to HTTPs redirecting.
_layout page