{"action":"created","issue":{"url":"https://api.github.com/repos/puma/puma-dev/issues/85","repository_url":"https://api.github.com/repos/puma/puma-dev","labels_url":"https://api.github.com/repos/puma/puma-dev/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/puma/puma-dev/issues/85/comments","events_url":"https://api.github.com/repos/puma/puma-dev/issues/85/events","html_url":"https://github.com/puma/puma-dev/issues/85","id":183095660,"number":85,"title":"Unable to serve the same app in different domains","user":{"login":"mrsimo","id":19203,"avatar_url":"https://avatars.githubusercontent.com/u/19203?v=3","gravatar_id":"","url":"https://api.github.com/users/mrsimo","html_url":"https://github.com/mrsimo","followers_url":"https://api.github.com/users/mrsimo/followers","following_url":"https://api.github.com/users/mrsimo/following{/other_user}","gists_url":"https://api.github.com/users/mrsimo/gists{/gist_id}","starred_url":"https://api.github.com/users/mrsimo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrsimo/subscriptions","organizations_url":"https://api.github.com/users/mrsimo/orgs","repos_url":"https://api.github.com/users/mrsimo/repos","events_url":"https://api.github.com/users/mrsimo/events{/privacy}","received_events_url":"https://api.github.com/users/mrsimo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-14T16:36:26Z","updated_at":"2016-10-20T13:45:05Z","closed_at":null,"body":"I have this use case that would be nice to support:\r\n\r\n```\r\n[~/.puma-dev] $ ls -lah\r\n[...]\r\nlrwxr-xr-x   1 albert  staff    23B Oct  7 19:40 harvestapp -> /Volumes/wrk/harvestapp\r\nlrwxr-xr-x   1 albert  staff    23B Oct 14 18:26 other-domain -> /Volumes/wrk/harvestapp\r\n```\r\n\r\nWe do this because we serve the standard app and the admin in different domains. Hitting the same app from both endpoints ends up in an error on the second one:\r\n\r\n```\r\n! Booting app 'harvestapp' on socket /Users/albert/.puma-dev/harvestapp/tmp/puma-dev-83010.sock\r\nharvestapp[83184]: bash: no job control in this shell\r\nharvestapp[83184]: [83184] Puma starting in cluster mode...\r\nharvestapp[83184]: [83184] * Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity\r\nharvestapp[83184]: [83184] * Min threads: 0, max threads: 1\r\nharvestapp[83184]: [83184] * Environment: development\r\nharvestapp[83184]: [83184] * Process workers: 4\r\nharvestapp[83184]: [83184] * Phased restart available\r\nharvestapp[83184]: [83184] * Listening on unix:/Users/albert/.puma-dev/harvestapp/tmp/puma-dev-83010.sock\r\nharvestapp[83184]: [83184] Use Ctrl-C to stop\r\n! App 'harvestapp' booted\r\nharvestapp[83184]: [83184] - Worker 2 (pid: 83785) booted, phase: 0\r\nharvestapp[83184]: [83184] - Worker 0 (pid: 83783) booted, phase: 0\r\nharvestapp[83184]: [83184] - Worker 1 (pid: 83784) booted, phase: 0\r\nharvestapp[83184]: [83184] - Worker 3 (pid: 83786) booted, phase: 0\r\n```\r\n\r\n```\r\n! Booting app 'other-domain' on socket /Users/albert/.puma-dev/other-domain/tmp/puma-dev-83010.sock\r\n! App 'other-domain' booted\r\nother-domain[83791]: [83791] Puma starting in cluster mode...\r\nother-domain[83791]: [83791] * Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity\r\nother-domain[83791]: [83791] * Min threads: 0, max threads: 1\r\nother-domain[83791]: [83791] * Environment: development\r\nother-domain[83791]: [83791] * Process workers: 4\r\nother-domain[83791]: [83791] * Phased restart available\r\nother-domain[83791]: [83791] * Listening on unix:/Users/albert/.puma-dev/other-domain/tmp/puma-dev-83010.sock\r\nother-domain[83791]: bundler: failed to load command: puma (/Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/bin/puma)\r\nother-domain[83791]: RuntimeError: There is already a server bound to: /Users/albert/.puma-dev/other-domain/tmp/puma-dev-83010.sock\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/lib/puma/binder.rb:359:in `add_unix_listener'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/lib/puma/binder.rb:138:in `block in parse'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/lib/puma/binder.rb:85:in `each'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/lib/puma/binder.rb:85:in `parse'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/lib/puma/cluster.rb:393:in `run'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/lib/puma/launcher.rb:172:in `run'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/lib/puma/cli.rb:74:in `run'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/gems/puma-3.6.0/bin/puma:10:in `<top (required)>'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/bin/puma:23:in `load'\r\nother-domain[83791]:   /Users/albert/.rbenv/versions/2.3.1/gemsets/harvestapp/bin/puma:23:in `<top (required)>'\r\n! Killing 'other-domain' (83791)\r\n* App 'other-domain' shutdown and cleaned up\r\n```\r\n\r\nI've tried setting up a custom puma config file and call `pidfile` on there, but it's not working.\r\n\r\nIt works fine if I boot the app manually and point both domains to the proper port instead, but we're trying to get an easy setup where people don't have too boot servers manually.\r\n\r\nThank you! ❤️ "},"comment":{"url":"https://api.github.com/repos/puma/puma-dev/issues/comments/255109849","html_url":"https://github.com/puma/puma-dev/issues/85#issuecomment-255109849","issue_url":"https://api.github.com/repos/puma/puma-dev/issues/85","id":255109849,"user":{"login":"mrsimo","id":19203,"avatar_url":"https://avatars.githubusercontent.com/u/19203?v=3","gravatar_id":"","url":"https://api.github.com/users/mrsimo","html_url":"https://github.com/mrsimo","followers_url":"https://api.github.com/users/mrsimo/followers","following_url":"https://api.github.com/users/mrsimo/following{/other_user}","gists_url":"https://api.github.com/users/mrsimo/gists{/gist_id}","starred_url":"https://api.github.com/users/mrsimo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrsimo/subscriptions","organizations_url":"https://api.github.com/users/mrsimo/orgs","repos_url":"https://api.github.com/users/mrsimo/repos","events_url":"https://api.github.com/users/mrsimo/events{/privacy}","received_events_url":"https://api.github.com/users/mrsimo/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T13:45:05Z","updated_at":"2016-10-20T13:45:05Z","body":"Oh, I totally missed that. Thanks!"}}
{"actor":{"display_login":"mrsimo"}}