소켓 구성을 통해 JSON API 서비스에 대한 요청을 처리 응답 {"res":"pong"}
의 nginx는
지금, 프로덕션 환경에서 설정하려고합니다. 그래서 푸마와 nginx 설정에서 실행하기로 결정했습니다. 푸마를 설치하고 소켓에서 실행했습니다. 이 같은 설정으로
⇒ bundle exec puma -b unix:///tmp/my_app.sock
Puma starting in single mode...
* Version 2.10.2 (ruby 2.1.2-p95), codename: Robots on Comets
* Min threads: 0, max threads: 16
* Environment: development
env :: development
Service started, go to town.
* Listening on unix:///tmp/my_app.sock
Use Ctrl-C to stop
설정의 nginx :
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
upstream my_app {
server unix:///tmp/my_app.sock;
}
server {
listen 8989;
server_name my_app;
root /Volumes/dev/my_app;
access_log /Volumes/dev/my_app/service/log/host.access.log;
error_log /Volumes/dev/my_app/service/log/error.access.log;
location/{
root /Volumes/dev/my_app/;
gzip_static on;
expires max;
add_header Cache-Control public;
}
}
나는이 같은 역할을 할 전망이다. 나는 http://localhost:8989/api/v1/ping
으로 찾아 갔지만 nginx에서 404 Not Found
을 얻었다.
오류 로그가 나타났다 :
2015/01/07 21:51:15 [error] 62300#0: *2 open() "/Volumes/dev/my_app/api/v1/ping" failed (2: No such file or directory), client: 127.0.0.1, server: my_app, request: "GET /api/v1/ping HTTP/1.1", host: "localhost:8989"