Nette v3 redirect HTTP to HTTPS

janzen01
Member | 1
+
0
-

Hello,

I'm using Nette v3, and I'm having a routing problem.

The application is deployed using a Docker in Azure App Service (AAS). AAS provides web security, HTTPS, etc., and expects the web application on port 80.

The web server is NGINX, which listens on port 80, this is where my problem stems. Because of this, Nette identifies the run as HTTP and generates all the links as HTTP. Azure adds HTTPS on top of that, including the certificate.

The request path is as follows: GET to HTTPS → AAS → forward to internal HTTP port 80 → handle request → reply to AAS → send a reply as HTTPS.

This works correctly in Browser. The problem occurs when embedding using iframes in Microsoft Teams, where it crashes on Mixed Request.

Would anyone know how to solve this, i.e., make Nette generate links on HTTPS?

Thanks

Marek Bartoš
Nette Blogger | 1261
+
+2
-

Problem with http links usually occurs when web is behind a proxy
https://doc.nette.org/…onfiguration#…

To quickly verify if it's the problem, you can simply configure all addresses are from the proxy. But you should use only range of addresses used by the server.

http:
	proxy:
		- 0.0.0.0/0
		- ::/0