nginx config
server {
listen 80xx;
server_name _;
index index.html;
root /xxx/www/project/;
location / {
try_files $uri $uri/ /index.html;
}
}
复制代码
IIS config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="iisstart.htm" />
<add value="default.aspx" />
</files>
</defaultDocument>
<rewrite>
<rewriteMaps>
<rewriteMap name="singlepage" />
</rewriteMaps>
<rules>
<rule name="single-page-route" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="/" logRewrittenUrl="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
复制代码
转载于:https://juejin.im/post/5bcc7fe3f265da0af213a3cd