如何更改托管为Windows服务的Blazor服务器应用程序的URL。

huangapple go评论54阅读模式
英文:

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_"
				}
			}
		}
	}

huangapple
  • 本文由 发表于 2023年7月6日 17:44:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76627522.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定