在现有 Web 应用程序的新版本上工作,我需要 nginx 转发根 (/) 和多个要转发到 v2 基础架构(使用 proxy_pass)的特定 URI,而未指定的 URI 必须转发到 v1。
location = /specific_uri1
proxy_pass http://v2.webapp.com;
proxy_set_header Host v2-test.webapp.com;
add_header X-version v2;
add_header X-node $hostname;
}
location = /specific_uri2
proxy_pass http://v2.webapp.com;
proxy_set_header Host v2-test.webapp.com;
add_header X-version v2;
add_header X-node $hostname;
}
location / {
proxy_pass http://v2.webapp.com;
proxy_set_header Host v2-test.webapp.com;
add_header X-version v2;
add_header X-node $hostname;
}
location /(.*)$ {
proxy_pass http://v1.webapp.com;
proxy_set_header Host v1-test.webapp.com;
add_header X-version v1;
add_header X-node $hostname;
}
Run Code Online (Sandbox Code Playgroud)
最后一个 location 指令永远不会匹配,因此所有未声明的内容仍然属于 v2 Web 应用程序。我肯定对 …
对于我的一个应用程序,我有一个 Windows 服务(在 Windows Server 2012 R2 x64 上),它的作用是在不同的计划和触发器上执行许多作业。其中之一是在 Office 365 上重置用户密码。运行该服务的服务器安装了 Microsoft Online Services 登录助手和用于 Windows PowerShell 的 Microsoft Azure Active Directory 模块(MSOnline 版本 1.1.166.0)。
从 PowerShell 我可以成功地与我的用户调用以下内容。
$> $cred = Get-Credential
$> Connect-MsolService -Credential $cred
Run Code Online (Sandbox Code Playgroud)
如果我以帐户身份运行 PowerShell,我的服务启动时也能正常运行。从 Windows 服务运行重置密码功能失败并显示以下消息:
The term 'Connect-MsolService' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. …Run Code Online (Sandbox Code Playgroud) powershell .net azure microsoft-office-365 azure-active-directory