簡體   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