繁体   English   中英

Meteor,Angular routes,Nginx和SSL - 如何通过重写将路径/路径路由到另一台服务器

[英]Meteor, Angular routes, Nginx and SSL - how to route /path to another server with rewrite

我有:

  • DigitalOcean VPS
  • 在Angular中使用路由的流星应用程序
  • Nginx作为反向代理
  • 我的域的SSL,配置了Nginx(也将http重定向到https)
  • 另一个托管(!)与Wordpress博客那里
  • 一些doma.in与DNS设置为DigitalOcean VPS和Meteor应用程序就在那里

如何“重写”doma.in/blog到博客,但使用相同的URL? (没有重定向)。

试试这个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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM