Hi All,
I’m configuring a digitalocean server (ubuntu) to host 2 different websites. One is working just fine. The other, from the nginx logs is attempting to route fine but the puma server isn’t running.
How do I configure puma to run both apps on a single server? I’m really close but missing something critical. Puma is only listed in the ps list for the single app and I don’t seem to be able to get it started for the other.
Trying to start it manually results in:
$ start puma app=aamaxworks
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.155" (uid=1000 pid=6377 comm="start puma app=aamaxworks ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init ")
and no files are entered into the log, pids or sockets directories in the second app hierarchy.
the nginx log says:
which makes sense because the server hasn’t stared and the requested file isn’t there…
I was able to (finally) manually start the second server with the following command:
and then both sites were accessible from the net.
I have 2 files in my /etc/nginx/sites-available. One for each application:
upstream app {
# Path to Puma SOCK file, as defined previously
server unix:/home/deploy/sites/mthost/shared/sockets/puma.sock fail_timeout=0;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/deploy/sites/mthost;
try_files $uri/index.html $uri @app;
location @app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
and
upstream aamax_app {
# Path to Puma SOCK file, as defined previously
server unix:/home/deploy/sites/aamaxworks/shared/sockets/puma.sock fail_timeout=0;
}
server {
listen 80;
listen [::]:80;
root /home/deploy/sites/aamaxworks;
try_files $uri/index.html $uri @aamax_app;
location @aamax_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
}
error_page 500 502 503 504 /500.html;
client_max_body_size 4G;
keepalive_timeout 10;
}
I seem to be missing something (small) but I don’t know what… any help would be appreciated!
thanks in advance,
Max