meteor,Angular路线,Nginx和SSL – 如何路由/重写path到另一台服务器

我有:

  • DigitalOcean VPS
  • meteor应用与Angular路由
  • Nginx作为反向代理
  • 我的域的SSL,configuration了Nginx(也redirecthttp到https)
  • 另一个托pipe(!)与WordPress的博客那里
  • DNS设置为DigitalOcean VPS和meteor应用程序的东西doma.in在那里

我该如何“重写”doma.in/blog到博客,但是使用这个相同的URL? (没有redirect)。

试试这个nginx配置:

location ^/blog { rewrite /blog(.*) $1 break; #cut the /blog path proxy_pass http://blog.com:8000; #then pass it to the blog domain/port proxy_redirect off; #without redirecting proxy_buffering off; #or buffering } 

至于角度,它只是需要避免/跳过路线, 这里讨论的SO