我为本教程设置了服务器(https://coderwall.com/p/ttrhow/deploying-rails-app-using-nginx-puma-and-capistrano-3)当我使用一个项目时,一切正常,但当我向这个VPS添加另一个项目时,我有错误[emerg] 20737#0:在/ et...
我为本教程设置了服务器(https://coderwall.com/p/ttrhow/deploying-rails-app-using-nginx-puma-and-capistrano-3)
当我使用一个项目时,一切正常,但当我向这个VPS添加另一个项目时,我有错误
[emerg] 20737#0:在/ etc / nginx / sites-enabled / vsejalreg中复制上游“puma”:1
我的nginx的配置
upstream puma {
server unix:///home/deployer/apps/vsejalreg/shared/tmp/sockets/vsejalreg-puma.sock;
}
server {
listen 80;
server_name wjreg.rubyserv.ru www.wjreg.rubyserv.ru;
root /home/deployer/apps/vsejalreg/current/public;
access_log /home/deployer/apps/vsejalreg/current/log/nginx.access.log;
error_log /home/deployer/apps/vsejalreg/current/log/nginx.error.log info;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @puma;
location @puma {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 10M;
keepalive_timeout 10;
}
和
upstream puma {
server unix:///home/deployer/apps/register/shared/tmp/sockets/register-puma.sock;
}
server {
listen 80;
server_name ws.rubyserv.ru www.ws.rubyserv.ru;
root /home/deployer/apps/register/current/public;
access_log /home/deployer/apps/register/current/log/nginx.access.log;
error_log /home/deployer/apps/register/current/log/nginx.error.log info;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @puma;
location @puma {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 10M;
keepalive_timeout 10;
}
当我逐个添加nginx配置 – 所有工作!
如何解决这个包或美洲狮不能与许多项目合作?
谢谢!
解决方法:
Puma适用于任何正确配置的项目:)您可以只配置一次命名上游(上游美洲狮),而不是每个服务器配置.如果每个服务器需要不同的puma实例,只需使用不同的名称设置上游.
upstream puma_vsejalreg {
server unix://...PATH.../vsejalreg-puma.sock;
}
upstream puma_register {
server unix://...PATH.../register-puma.sock;
}
本文标题为:ruby-on-rails – rails nginx puma在/ etc / nginx / sites-enabled中复制上游“puma”
基础教程推荐
- asm基础——汇编指令之in/out指令 2023-07-06
- UEFI开发基础HII代码示例 2023-07-07
- R语言基于Keras的MLP神经网络及环境搭建 2022-12-10
- R语言-如何将科学计数法表示的数字转化为文本 2022-11-23
- swift 字符串String的使用方法 2023-07-05
- swift版webview加载网页进度条效果 2023-07-05
- R语言数可视化Split violin plot小提琴图绘制方法 2022-12-10
- R包ggtreeExtra绘制进化树 2022-12-14
- Go web部署报错panic: listen tcp xxxxxxx:8090: bind: cannot assign requested address 2023-09-05
- ruby-on-rails-使用Nginx的Rails的多阶段环境 2023-09-21