您的位置:首页 > 运维架构 > Nginx

【备忘】nginx 配置 某个路径代理

2014-12-15 09:36 134 查看
server {
        listen 80;
        #rewrite     ^/\w+$   /main.html     break;
        server_name     aaa.com;
        location ^~ /api/ {
                proxy_pass http://xxx.com;                 proxy_redirect off;
        }

        location ^~ / {
                rewrite    ^.*(\/\w+(\/)?)$    /main.html      break;
                root   /var/www/qs-test;
                index  main.html main.htm;
        }

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: