nginx - redirect a certain path to another domain

后端 未结 1 1108
深忆病人
深忆病人 2020-12-14 18:53

I am very unfamiliar with nginx, as a forewarning, and also can\'t find any actual references on the regex system they use. So right now it\'s a black box to me.

All

1条回答
  •  北海茫月
    2020-12-14 19:37

    I made a solution that works. I had it before posting this question but didn't realize I needed to restart nginx. Put the following inside your server block.

    rewrite ^(/mydirectory/)(.*)$ http://www.myotherdomain.com/$2 permanent;
    

    0 讨论(0)
提交回复
热议问题