doufang3001 2016-03-24 03:29
浏览 34

宁静的天蓝色网站

I would just like to know how to configure Azure for it to load my practice website properly. I found a tutorial and downloaded the file at http://www.angularcode.com/demo-of-a-simple-crud-restful-php-service-used-with-angularjs-and-mysql/. I have tried this Restful files in my localhost and it works just fine however when I upload the files to Azure using Transmit it does not load and returns angular.min.js:72 GET https://ptamob.azurewebsites.net/services/customers 404 (Not Found). I have tried to upload the same set of files to hostinger.ph and it works. I would like to know how to fix this this and also the difference why its loading in hostinger and not in Azure. Thank you.

  • 写回答

1条回答 默认 最新

  • duanguilin2007 2016-04-12 06:18
    关注

    According to the tuturial, I think the issue was caused by the configuration for url rewrite rules on the http server. Azure support the feature of url rewrite rules via Azure IIS server, not Apache http server.

    So the url rewrite rule configuration for Apache http server need to be translated for IIS server.

    You can try to access the Kudu console for your webapp via the url https://<your-webapp-name>.scm.azurewebsites.net/DebugConsole and configure the Web.config file at the path D:\home\site\wwwroot.

    The rewrite rule configuration for web.config like this as below.

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="Main Rule" stopProcessing="true">
                        <match url=".*" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php" />
                    </rule>
                </rules>
            </rewrite>
        </system.webServer>
    </configuration>
    

    Please refer to the section Configure the URL rewrite of the doc "Azure : Create an URL Rewrite Azure Web App".

    评论

报告相同问题?

悬赏问题

  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本