How to start faye server on a rails app deployed using dokku?

半城伤御伤魂 提交于 2019-12-04 19:45:32

You need to make several steps to have working faye server (e.g. on port 9292):

  1. Your Procfile is OK
  2. Expose port 9292 on Docker. I recommend install docker-options plugin and next dokku docker-options:add timer "-p 9292:9292"
  3. Setup your app nginx.conf. Mine is here:

    upstream app { server 127.0.0.1:49154; }
      server {
      listen      [::]:80;
      listen      80;
      server_name app.dokku.mine;
      location    / {
        proxy_pass  http://app;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Port $server_port;
        proxy_set_header X-Request-Start $msec;
    }
      location /faye {
        proxy_redirect     off;
        proxy_set_header   Upgrade    $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_http_version 1.1;
        proxy_buffering    off;
        proxy_cache_bypass $http_pragma $http_authorization;
        proxy_no_cache     $http_pragma $http_authorization;
        proxy_pass http://localhost:9292;
      }
    }
    

I suggest to install nginx-alt plugin because config is overwritten on every deploy.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!