nginx 配置文件:
upstream app_hyperion {
server unix:/tmp/unicorn.hyperion.sock;
}
server {
listen 9001;
server_name localhost;
root /home/ubuntu/deploy/rhea/public;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby {
proxy_pass http://app_hyperion ;
}
}
server {
listen 9002;
server_name localhost;
root /home/ubuntu/deploy/hyperion/public;
index index.html;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
try_files /system/maintenance.html $uri $uri/index.html $uri.html @ruby;
}
location @ruby {
proxy_pass http://app_hyperion ;
}
}