【发布时间】:2016-02-10 00:22:54
【问题描述】:
我正在尝试使用 nginx 创建一个重写,它会更改显示的 URL 而不会实际重定向到它。例如:http://example.com/item/rest-of-path 将变为 http://example.com/folder/rest-of-path。我一直在我的 nginx.conf 中使用此代码的不同变体:
location ~ /example {
rewrite ^/example/(.*) /folder/$1 last;
}
但这似乎并不奏效。有什么想法我在这里出错了吗?我承认我对服务器端重写还是很陌生。
【问题讨论】: