简体   繁体   中英

How to run 2 rails servers in production

I have a scenario where I need to have a rails server listening on 2 different ports. There's a service that's posting a bunch of data to the server and that service can only talk to port 10000. I also need the rails server to listen on port 80 for http requests. Currently, I start the first one (server1) with:

bundle exec rails s -e production -p 10000

And the second one (sever2) with:

bundle exec rails s -e production -p 80 -P server2.pid

This works fine for the most part except for one thing. Whenever I try to load a page using http, server2 will print to console ALL the post requests made to server1 first before rendering my page. It's as if server2 needs to resynchronize with server1 before it can serve my page. I'm wondering why this happens and what the proper way to run 2 servers is.

安装了ngix并根据https://gist.github.com/jeffrafter/1229497将2个端口转发到我的服务器

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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