【发布时间】:2017-04-02 16:32:48
【问题描述】:
网址https://example.com/profile/chico
nginx必须理解为:
https://example.com/profile/?username=chico(当前有效的网址)。
https://example.com/profile/ 目前也可以正常工作,因为它目前解析为 index.php,没有用户名参数。
我现在有
location /profile/ {
index /profile/index.php;
}
网络上有很多不同的东西,我没有找到我需要的具体内容。
也试过了
location /profile/ {
rewrite ^/profile/(.*)$ /profile/?username=$1;
}
【问题讨论】: