Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

works in browser but 502 status when directly connecting to websocket #1161

Closed
foysalit opened this issue Jun 10, 2020 · 1 comment
Closed

Comments

@foysalit
Copy link

Mup version (mup --version): 1.5.1

Mup config

{
  "servers": {
    "one": {
      "host": "1.2.3.4",
      "username": "ubuntu",
      "pem": "~/.ssh/pem"
    }
  },
  "app": {
    "name": "my-app",
    "path": "../",
    "servers": {
      "one": {}
    },
    "buildOptions": {
      "serverOnly": true
    },
    "env": {
      "ROOT_URL": "https://subdomain.host.com",
      "MONGO_URL": "mongodb://user:pass@subdomain.subdomain.host.com:27017/rift-app",
      "VIRTUAL_HOST": "api.theriftapp.com",
      "HTTPS_METHOD": "redirect",
      "LETSENCRYPT_HOST": "api.theriftapp.com",
      "LETSENCRYPT_EMAIL": "email@domain.com",
      "VIRTUAL_PORT": 3000,
      "HTTP_FORWARDED_COUNT": 1
    },
    "docker": {
      "image": "abernix/meteord:node-12-base",
      "stopAppDuringPrepareBundle": true,
      "imagePort": 3000
    },
    "enableUploadProgressBar": true,
    "type": "meteor"
  },
  "proxy": {
    "domains": "api.theriftapp.com",
    "ssl": {
      "forceSSL": true,
      "letsEncryptEmail": "email@domain.com"
    }
  }
}

Thank you for this amazing package. I have this peculiar problem where the app is deployed on aws ec2 and it all works fine in browser. However, I can't connect using websocket directly. The app runs at https://api.theriftapp.com and it all works when loaded through the browser. If I try to connect using new WebSocket('wss://api.theriftapp.com') or using wscat it throws a 502 error. This is the output from nginx log:

[error] 177#177: *75 upstream prematurely closed connection while reading response header from upstream, client: 82.xx.xx.xxx, server: api.theriftapp.com, request: "GET / HTTP/1.1", upstream: "http://172.17.0.4:3000/", host: "api.theriftapp.com"

Which leads me to believe that I might need some kind of extra nginx config and was hoping that someone can shed some light on the direction I need to take to figure it out.

@foysalit
Copy link
Author

Ok I'm just a dummy, connecting to new WebSocket('wss://api.theriftapp.com/websocket') works just fine as expected. I was just missing the websocket suffix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant