delphinginxlogoutintraweb

How to return to the login page in VCL for the web/Intraweb?


I have an application built with Delphi 10 / VCL for the web - Intraweb 14.2.7.

I implemented the Logout feature that basically does this:

// Appurl := WebApplication.ApplicationURL;
WebApplication.TerminateAndRedirect(Appurl+'/$/');

This works in most cases, but when the app runs behind a reverse Proxy (I use NGINX) WebApplication.ApplicationURL is not as I expect.

From localhost my app runs at http://127.0.0.1:8000/$/ and in localhost WebApplication.ApplicationURL is http://127.0.0.1:8000

while using reverse proxy (so accessing from any other machine) the app is reachable at https://myapp.mycompany.com/$/ and in this case WebApplication.ApplicationURL is http://myapp.mycompany.com:8000 therefore on logout the app redirects the browser to http://myapp.mycompany.com:8000/$/ that does not exist.

Probably by fine-tuning NGINX it is possible to find a workaround anyway I would like to ask whether Intraweb has a built in system to go back to the main URL.


Solution

  • As suggested in the comment you can try to use WebApplication.TerminateAndRedirect('/$/'); avoiding the absolute address