windows-servicesblazor-server-sideasp.net-core-hosted-services

How to change URL of a Blazor server app that hosted as a windows service


I've a Blazor server app that is installed as windows service and runs fine. The default application URL is "http://localhost:5000" and I want to configure it so that it could be rechable from outside the server, also I need to configure it for a universal URL for example "http://example.com/myapp". How can I do it?


Solution

  • I do this in my appsettings.json

        "Kestrel": {
            "Endpoints": {
                "HttpsInlineCertFile": {
                    "Url": "https://myserver:port",
                    "Certificate": {
                        "Path": "path_to_my.pfx",
                        "Password": "_cert_password_"
                    }
                }
            }
        }