将web.config转换为nginx配置?

时间:2017-03-06 06:58:34

标签: .htaccess iis nginx webserver

我想知道是否有人能指出我将这个IIS web.config代码转换为nginx配置的正确方向?谷歌上的所有内容都是关于如何将.htaccess转换为nginx配置,而不是关于web.config?

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <compilation debug="false" />
  </system.web>



  <system.net>
    <connectionManagement>
      <add address="*" maxconnection="2300" />
    </connectionManagement>
  </system.net>

  <system.webServer>
    <httpErrors errorMode="Custom" existingResponse="Replace">
      <remove statusCode="403" />
      <error statusCode="403" responseMode="File" path="403.php" />
      <remove statusCode="404" />
      <error statusCode="404" responseMode="File" path="404.php" />
    </httpErrors>

    <rewrite>
      <rules>
        <rule name="Rule 1">
          <match url="^habbo-imaging/badge/([^/]+)" ignoreCase="false" />
          <action type="Rewrite" url="/habbo-imaging/badge.php?badge={R:1}" appendQueryString="false" />
        </rule>

        <rule name="Rule 2">
          <match url="^habbo-imaging/avatar/([^/]+)" ignoreCase="false" />
          <action type="Rewrite" url="habbo-imaging/avatarimage.php?figure={R:1}" appendQueryString="false" />
        </rule>

        <rule name="Rule 3">
          <match url="^habbo-imaging/avatarimage/([^/]+)" ignoreCase="false" />
          <action type="Rewrite" url="habbo-imaging/avatarimage.php?username={R:1}" appendQueryString="false" />
        </rule>

        <rule name="Rule 4">
          <match url="^habbo-imaging/head/([^/]+)" ignoreCase="false" />
          <action type="Rewrite" url="habbo-imaging/head.php?figure={R:1}" appendQueryString="false" />
        </rule>

        <rule name="Rule 5">
          <match url="^gamedata/habbopages/chat/commands" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/habbopages/chat/commands.txt" appendQueryString="false" />
        </rule>

        <rule name="Rule 6">
          <match url="^gamedata/habbopages/chat/options" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/habbopages/chat/options.txt" appendQueryString="false" />
        </rule>

        <rule name="Rule 7">
          <match url="^gamedata/supersecret" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/supersecret.php" appendQueryString="true" />
        </rule>

        <rule name="Rule 8">
          <match url="^gamedata/external_variables" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/external_variables.txt" appendQueryString="false" />
        </rule>

        <rule name="Rule 9">
          <match url="^gamedata/external_flash_texts" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/external_flash_texts.txt" appendQueryString="false" />
        </rule>

        <rule name="Rule 10">
          <match url="^gamedata/override/external_flash_override_texts" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/override/external_flash_override_texts.php" appendQueryString="false" />
        </rule>

        <rule name="Rule 11">
          <match url="^gamedata/override/external_override_variables" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/override/external_override_variables.txt" appendQueryString="false" />
        </rule>

        <rule name="Rule 12">
          <match url="^gamedata/figuredata" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/figuredata.xml" appendQueryString="false" />
        </rule>

        <rule name="Rule 13">
          <match url="^gamedata/productdata" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/productdata.txt" appendQueryString="false" />
        </rule>

        <rule name="Rule 14">
          <match url="^gamedata/furnidata_xml" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/furnidata.xml" appendQueryString="false" />
        </rule>

        <rule name="Rule 15">
          <match url="^gamedata/habbopages/forums" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/habbopages/forums.txt" appendQueryString="false" />
        </rule>

        <rule name="API - Default">
          <match url="^api/([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
          <action type="Rewrite" url="api.php?request={R:1}" appendQueryString="false" />
        </rule> 

        <rule name="API - Rooms">
          <match url="^api/room/([0-9_-]+)(|/)$" ignoreCase="false" />
          <action type="Rewrite" url="api.php?request=room&amp;room_id={R:1}" appendQueryString="false" />
        </rule> 

        <rule name="API - Groups">
          <match url="^api/group/([0-9_-]+)(|/)$" ignoreCase="false" />
          <action type="Rewrite" url="api.php?request=group&amp;group_id={R:1}" appendQueryString="false" />
        </rule>

        <rule name="API - Users">
          <match url="^api/user/([a-zA-Z]+)/([a-zA-Z0-9_-]+)(|/)$" ignoreCase="true" />
          <action type="Rewrite" url="api.php?request=user&amp;search_type={R:1}&amp;value={R:2}" appendQueryString="false" />
        </rule>     

        <rule name="API - Random Users with limit">
          <match url="^api/users/([0-9]+)(|/)$" ignoreCase="false" />
          <action type="Rewrite" url="api.php?request=users&amp;amount={R:1}" appendQueryString="false" />
        </rule> 

        <rule name="HabboPages - Dynamic">
          <match url="^gamedata/habbopages/([0-9a-zA-Z]+)(|/)$" ignoreCase="false" />
          <action type="Rewrite" url="gamedata/habbopages/{R:1}.txt" appendQueryString="false" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

0 个答案:

没有答案