【发布时间】:2011-09-10 03:43:30
【问题描述】:
我是 nginx 新手,我已经安装了 php(使用端口 8888)和 nginx(使用端口 80),并且我有一个静态 html 页面,如 www.aa.com:8888/news/html/about/aboutus /index.html,现在我想用 www.aa.com/test/aboutus.html 来访问它,这样做时,浏览器中的 URL 应该不会改变。这个怎么做?
我尝试了一些方法,但浏览器中的链接只会重定向到新的 URL 字符串...
我在 nginx 的 conf 文件中的示例配置如下:
location ^~ /test/aboutus.html {
proxy_pass http://127.0.0.1:8888;
proxy_redirect default;
rewrite ^/test/aboutus.html$ /news/html/about/aboutus last;
break;
}
非常感谢!
【问题讨论】: