简体   繁体   English

Nginx位于node.js和apache的前面

[英]Nginx on front of node.js and apache

I have nginx running on port 80 with a proxy pass for multiple node.js instances. 我在端口80上运行了nginx,并为多个node.js实例进行了代理传递。

I'd like to also use nginx on the same port, to proxy for an apache instance running on another port, say 8888. 我还想在同一端口上使用nginx,以代理在另一个端口(例如8888)上运行的apache实例。

Here's the basics of my nginx.conf 这是我的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. 上游的两个是node.js实例。 But the /admin/ is for the site on apache, however it doens't work. 但是/admin/用于apache上的站点,但是它不起作用。

Is there another way to do this? 还有另一种方法吗?

Thank you! 谢谢!

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

http://nginx.org/r/proxy_pass http://nginx.org/r/proxy_pass

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM