我有一個我已經構建並在IIS服務器上運行的API。我的web.config文件如下:Slim Framework只能在本地服務器上工作
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="slim" patternSyntax="Wildcard">
<match url=".*" />
<conditions>
<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>
這可能是值得指出的是,我的結構如下:
wwwroot/
-web.config
-api/
--vendor
--src/
---index.php
我可以訪問API,讓我的本地服務器上的電話,和我整個API運行正常......問題是我無法從網絡上的其他機器訪問。錯誤消息是該網站無法到達/拒絕連接。我曾嘗試將web.config文件複製到每個目錄,以確保它不是文件所在位置的問題。我還創建了一個虛擬的「hello world」php腳本,並將其放置在服務器上以確保遠程計算機可以訪問,並且工作得很好。 (使用http://myservername/helloworld.php訪問)我似乎可以遠程訪問我放置在Web服務器上的任何內容,除了我的超薄API路由外。是否需要在SLIM或IIS中設置一些配置才能使其工作?