Azure的PHP应用服务上的重定向登录动作

问题描述 投票:2回答:1

想了解更多关于其他语言和云,我下载了一个PHP编写的开源应用程序运行在Azure上它:FoOlSlide2。它也知道它在运行时的XAMPP或WAMPP问题。

我能够建立所有App环境,创建和连接MySQL数据库和运行应用程序,并发挥自己的方法来安装,没有问题配置数据库。

但每次当我尝试使用有效凭据登录的时候,它是不是能够登录我,只是我重定向到登录页面一次。但是,当我尝试输入无效的凭证,没有HTTP重定向,也是我收到的无效尝试反馈。

做一些搜索like here,这让我觉得if could be a rewrite configuration error,因为有一个.htaccess转换成web.config文件。虽然,我这样做是使用自带的IIS URL重写生成我规则,也试过在线工具来进行这种转换对我来说,但这些都不奏效。

我也试过找Azure的门户里面的一些选项 - 应用服务,这可能是故障排除登录动作,但没有成功。 PHP版本是与项目(5.6)兼容,因为它的安装需要,并创建所需要的所有表的应用程序与数据库连接成功。

贝娄,所有相关的信息,我认为可以用来发现问题的,也是我可以提供更多的,如果必要的。

登录尝试风景W /凭据无效(按预期工作):

Request URL: https://xxxxxxxxxxxxx/account/auth/login/
Request Method: POST
Status Code: 200 OK
[...] Error response inside 

登录尝试风景瓦特/有效凭据(如预期不工作):

Request URL: https://xxxxxxxxxxxxx/account/auth/login/
Request Method: POST
Status Code: 302 Moved Temporarily
[Header] Location: https://xxxxxxxxxxxxx/account/profile/

Request URL: https://xxxxxxxxxxxxx/account/profile/
Request Method: POST
Status Code: 302 Moved Temporarily
[Header] Location: https://xxxxxxxxxxxxx/account/auth/login/

Request URL: https://xxxxxxxxxxxxx/account/auth/login/
Request Method: GET
Status Code: 200 OK
[Here I am back to login form even inputted valid credentials]

我的整个web.config文件(使用IIS URL重写生成的规则):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions>
            <add input="{R:1}" pattern="^(index\.php|assets|content|robots\.txt|favicon\.ico)" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Rewrite" url="./index.php?{R:1}" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>  
    <httpProtocol>
  <customHeaders>
    <remove name="ETag"/>
    <add name="Access-Control-Allow-Origin" value="*"/>
    <add name="X-UA-Compatible" value="IE=Edge,chrome=1"/>
    <remove name="X-Powered-By"/>
    <add name="Cache-Control" value="max-age=691200" />
  </customHeaders>
</httpProtocol>
<defaultDocument>
  <files>
    <clear />
    <add value="index.php" />
  </files>
</defaultDocument>
</system.webServer>
</configuration>

从GitHub(我曾经产生我的web.config的规则是谁).htaccess文件

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|content|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

**更多的信息更新:**

我也试图在Azure中部署其他应用程序服务,再次在PHP中,被称为MangaReader也是开源的,并且工作在WAMPP / XAMPP的罚款。我也有关于登录尝试类似的问题 - 而不是重定向本身,而是一个成功的状态代码无需身份验证即可。

和以前一样,我产生使用IIS URL重写基于.htaccess文件web.config文件;并且还能够配置所有数据库,并运行站点设置。在那之后,我对小疑问是一个项目的错误已经一去不复返了。

它看起来很是:

  • 而转换.htaccess文件到的web.config A错误;
  • Azure的门户网站应用服务里面的一些缺少配置;
  • 在IIS上一些缺少配置;
  • 任何未知错误。

**编辑2,附加信息**

这个问题本身是不是来管理基于PHP文件会话,因为FoOlSlide2和MangaReader(beforely都提到)做它在一个MySQL表。此外,FoOlSlide2具有负载均衡功能来处理请求的大量(水平缩放)

php azure .htaccess iis web-config
1个回答
1
投票

通过数据库,而不是一个PHP文件管理会话。 Azure是非常靠不住的,我觉得这是最好的GET-左右。

© www.soinside.com 2019 - 2024. All rights reserved.