我有個域名是 api.xx.com/activity
我想讓 api.xx.com/activity 的內(nèi)容由webman解析,其他的內(nèi)容由其他語言實現(xiàn)。
這樣的情況下我的路由應(yīng)該怎么配置呢,我的webman是多應(yīng)用,并且每個應(yīng)用都是基于 api.xx.com/activity 來訪問的,比如a b c應(yīng)用:
api.xx.com/activity/a
api.xx.com/activity/b
api.xx.com/activity/c
請教大佬!
路由改成這樣,訪問/activity/index/index會自動訪問 'app\controller\index@index,不用配置路由。
location /activity/ {
rewrite ^/activity(/.*)$ $1 break;
proxy_pass http://127.0.0.1:8787;
}
謝謝大佬,我試了一下這樣子不行,請求能進入webman了,但是webman一直返回404(不是nginx返回404),試了下還是要加路由的。我是這樣配的:rewrite ^/activity/$ /$1 break; proxy_pass http://127.0.0.1:8787;