bialasikk
bialasikk

Reputation: 1065

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

I have:

How can I "rewrite" doma.in/blog to the blog, but with this same URL? (without redirect).

Upvotes: 4

Views: 517

Answers (1)

Tudor Ilisoi
Tudor Ilisoi

Reputation: 2944

Try this nginx configuration:

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
}

As for angular, it simply needs to avoid/skip the route, as discussed here on SO

Upvotes: 2

Related Questions