4

I have:

  • DigitalOcean VPS
  • Meteor application with routing in Angular
  • Nginx as a reverse-proxy
  • SSL for my domain, configured with Nginx (also redirecting http to https)
  • another hosting (!) with Wordpress blog there
  • something doma.in with DNS set to DigitalOcean VPS and Meteor app is there

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

bialasikk
  • 995
  • 1
  • 7
  • 8
  • Not really sure what you're attempting to do here. You have an angular app running on doma.in/ (in the index.html) file, and a blog on doma.in/blog, and you want links from the angular app that land on doma.in/blog to land in the wordpress page instead of a subroute in angular? Or do you just want people landing on doma.in/blog to see the wordpress blog, despite the wordpress blog having a different url? – pfooti Apr 07 '16 at 21:31

1 Answers1

2

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

Community
  • 1
  • 1
Tudor Ilisoi
  • 2,934
  • 23
  • 25