简体   繁体   中英

Rails production with puma and nginx puma.sock missing

I'm setting up my rails production server on digital ocean with puma and nginx.

Following tutotials I have entered this in my /etc/nginx/sites-available/default

server unix:/home/deploy/appname/shared/sockets/puma.sock fail_timeout=0;

But on the server the folder home/deploy/appname/shared/sockets/ is empty.

I double checked the tutorials and none of them mentions creating such file.

If I run ps aux | grep puma ps aux | grep puma I get

root 2076 0.0 0.3 52992 3544 pts/0 T 05:51 0:00 sudo nano require capistrano/puma root 2077 0.0 0.3 23872 3888 pts/0 T 05:51 0:00 nano require capistrano/puma rails 2407 0.0 0.0 14484 1012 pts/0 S+ 06:38 0:00 grep puma

which it doesn't really makes sense to me as I'm not using capistrano.

My question is. How is puma.sock created? During puma installation? What step have I missed if that directory is empty?

Without capistrano you need to start puma with -b option to create sock file:

puma -b unix:///__abs_path_to_your_app__/puma.sock

and in /etc/nginx/sites-available/default you need to change path to .sock file:

server unix:///__abs_path_to_your_app__/puma.sock fail_timeout=0;

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