英文:
How to change URL of a Blazor server app that hosted as a windows service
问题
我有一个作为Windows服务安装的Blazor服务器应用程序,它正常运行。默认的应用程序URL是"http://localhost:5000",我想配置它以便可以从服务器外部访问,还需要配置一个通用URL,例如"http://example.com/myapp"。我该如何做?
英文:
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?
答案1
得分: 0
我在我的 appsettings.json
中这样做:
"Kestrel": {
"Endpoints": {
"HttpsInlineCertFile": {
"Url": "https://myserver:port",
"Certificate": {
"Path": "path_to_my.pfx",
"Password": "_cert_password_"
}
}
}
}
英文:
I do this in my appsettings.json
"Kestrel": {
"Endpoints": {
"HttpsInlineCertFile": {
"Url": "https://myserver:port",
"Certificate": {
"Path": "path_to_my.pfx",
"Password": "_cert_password_"
}
}
}
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论