0

I have nginx running on port 80 with a proxy pass for multiple node.js instances.

I'd like to also use nginx on the same port, to proxy for an apache instance running on another port, say 8888.

Here's the basics of my nginx.conf

   upstream localhost {
           server 127.0.0.1:8000;
           server 127.0.0.1:8001;
    }

    server {
            listen       80;
            server_name  localhost;

            location / {
                proxy_pass http://localhost;
            }

            location /admin/ {
                proxy_pass 127.0.0.1:8888;
            }

    }

The two upstream's are node.js instances. But the /admin/ is for the site on apache, however it doens't work.

Is there another way to do this?

Thank you!

1 Answer 1

1
location /admin/ {
    proxy_pass http://127.0.0.1:8888;
}

http://nginx.org/r/proxy_pass

Sign up to request clarification or add additional context in comments.

6 Comments

Hm, doesn't seem to work. Maybe a conflict with the upstream?
And what do you mean by "don't work"? Are you sure that your apache working and configured correctly?
It says: Not Found The requested URL /admin/ was not found on this server., If I access the page directly though with port 8888 it works. Apache is running.
What URL do you use to access it directly? There's a big difference between http://127.0.0.1:8888/ and http://127.0.0.1:8888/admin/.
I use http://127.0.0.1:8888/ to access it directly, then through Nginx, I was using http://127.0.0.1:80/admin
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.