gpt4 book ai didi

linux - http 重定向 azure web 应用程序

转载 作者:太空宇宙 更新时间:2023-11-04 11:50:39 26 4
gpt4 key购买 nike

我的公司有一个运行 tomcat 9.0 的 azure linux web 应用程序。

我需要设置一个 http 307 重定向以将用户定向到另一个网站(不是托管在 azure 上)。

我看到这篇关于如何在网络应用程序上进行重定向的文章: https://michelebusta.com/azure-tip-just-a-web-app-with-redirect-please-a045d1072659

但我认为该文章仅适用于 Windows 实例。

如何在 Linux 中运行的网络应用程序上完成此操作?

最佳答案

要在 Apache Linux Web App 上完成 URL 重写,您可以遵循以下过程。

  1. 在您网站的/home/site/wwwroot/中创建一个 htaccess 文件。
  2. 使用 mod_rewrite module制定如下类似的规则。下面的例子是 rewriting URLs from HTTP to HTTPS .

    • 开启重写引擎
    • RewriteCond %{HTTP:X-ARR-SSL} ^$
    • 重写规则 ^(.*)$ https://% {HTTP_HOST}%{REQUEST_URI} [L,R=301]

关于linux - http 重定向 azure web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56149316/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com