Cannot redirect to external link from angularjs in same domain nginx

I am running a Node app at port 3000, which my Nginx server is successfully redirecting to from port 80. But within my Node app I have a wordpress blog which I am running using Apache at port 8080. I am unable to link node app to this blog, and keep getting a 404 error. Here are the things I have done:

  1. Set up my nginx to redirect to on /blog

    server {
    location / {

    location /blog {
    rewrite ^/blog(.*) /$1 break;

  2. Pointed my Apache to 8080 to root folder of wordpress at /var/www/htdocs

  3. Within my MEAN app link blog with a target=_self
    [NOTE: have also tried ng-click=”$event.stopPropagation()” and window.location= ‘/blog’ on ng-click]

Now I keep getting redirected to /blog#!/ and given a 404 error within my app itself. Being my first MEAN app, I am a little new to this, so please bear with me if the answer is obvious, cause I fail to see it.

EDIT: Apparently I haven’t set up Apache correctly as I cannot access anything at port 8080, when trying to access myip:8080 from the outside

Source: apache

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.