I have one rails application needed to be deployed by passenger module nginx. This application needs to be served for hundred domain names. I don't have enough memory to launch hundred rails instances. I'm not sure the proper way to launch rails in few instances. It's the same application under different domain names.
server {
listen 80;
server_name www.a_domain.com;
root /webapps/mycook/public;
passenger_enabled on;
}
server {
listen 80;
server_name www.b_domain.com;
root /webapps/mycook/public;
passenger_enabled on;
}
server {
listen 80;
server_name www.c_domain.com;
root /webapps/mycook/public;
passenger_enabled on;
}
As you can the above code, it would launch three rails instances. It would be nice to launch only instance to serve under these 3 domain. Anyone has some suggestions?
Just set up multiple domain aliases for that server entry.
server {
listen 80;
server_name www.a_domain.com www.b_domain.com www.c_domain.com;
root /webapps/mycook/public;
passenger_enabled on;
}
That'll serve requests to each of those domains, and all hit the same app pool.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With