How to use different rails_env with nginx, passenger and redmine

I need redmine to work in conjunction with nginx, phusion passenger and mysql. Because of the project, several instances of redmine are required, which must be implemented using different rails_env, I tried to install them on different vhosts servers with nginx.

An example of one vhost:

server {
    listen xxxx;
    server_name redmine.xxxxx;
    root /xxxxx/redmine/public;
    passenger_enabled on;
    rails_env production;
}

The same applies to another vhost server, but there server_name is mapped to a different domain, and rails_env is mapped to an internal one.

The problem is that nginx just uses one of both rails_env for both redmine instances, and not one for each. Any advice on how to use different rails_env with the same application, nginx and phusion passenger?

thank

+3
source share
2

, . , (/) DNS (redmine.development/redmine.production)???

, , rails, root. root nginx, , . , , redmine.production, . , , redmine.development, .

, , . - , .

.)

~/rails_apps/myserver ( myserver , public ..)

~/rails_apps/dev.myserver ~/rails_apps/myserver, - ~/rails_apps/pro.myserver ~/rails_apps/myserver.

nginx root.

, symlink/home/user/rails_apps/[dev|pro].redmine /home/user/rails _apps/redmine)

server {
    listen xxxx;
    server_name redmine.development;
    root /home/user/rails_apps/dev.redmine/public;
    passenger_enabled on;
    rails_env development;
}
server {
    listen xxxx;
    server_name redmine.production;
    root /home/user/rails_apps/pro.redmine/public;
    passenger_enabled on;
    rails_env production;
}
+1

nginx ... /app/public directory ,
PASSENGER_APP_GROUP_NAME.
: -

server {
listen xxxx;
server_name redmine.xxxxx;
root /xxxxx/redmine/public;
passenger_enabled on;
rails_env production;
passenger_app_group_name devlopment;
 }

 server {
listen xxxx;
server_name redmine.xxxxx;
root /xxxxx/redmine/public;
passenger_enabled on;
rails_env production;
passenger_app_group_name production
}
0

Source: https://habr.com/ru/post/1794152/


All Articles