Realtime doesn’t work on a domain name

Hi,

I have deployed my application on an Amazon server and configured it using nginx, the realtime works using the IP address but on a domain name doesn’t seem to work.

I use the Subscription and the latest version 7.5.0

Is there any configuration that I need to do?

Thanks

Hi @imdev thanks for using Redwood Real-time. I have to confess your deployment is not one I’ve had experience with. We’ve deployed to baremetal and also to Fly and Render with susbscriptions.

Does any other part of graphql behave differently when deployed that way and accessing via ip or domain?

Are you seeing any CORS issues?

Can you see and subscriptions working in GraphQl playground?

Do you see any network issues like closing connections prematurely?

Could you share your server file config?

Hi @dthyresson thanks for your response.

I have tested with yarn rw dev, yarn rw serve & with baremetal, the Real-time doesn’t seem to work for me.

Here is the server file config using rw:

server {
    server_name example.com www.example.com;

    location / {
        proxy_pass http://localhost:8910;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }

    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = www.example.com) {
        return 301 https://$host$request_uri;
    }

    if ($host = example.com) {
        return 301 https://$host$request_uri;
    }

    listen 80;
    server_name example.com www.example.com;
    return 404;
}

And this for baremetal (I also tested the commented ones):

upstream redwood_server {
  server 127.0.0.1:8911 fail_timeout=0;
}

server {
#  root /home/user/apps/exapmle/current/web/dist;
  server_name example.com www.example.com;
#  index index.html;

  location / {
    proxy_pass http://localhost:8910;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }

#  gzip on;
#  gzip_min_length 1000;
#  gzip_types application/json text/css application/javascript application/x-javascript;

#  sendfile on;

#  keepalive_timeout 65;

#  error_page 404 /404.html;
#  error_page 500 /500.html;

#  location / {
#    try_files $uri /200.html =404;
#  }

#  location ^~ /static/ {
#    gzip_static on;
#    expires max;
#    add_header Cache-Control public;
#  }

  location ~ /api(.*) {
    rewrite ^/api(.*) $1 break;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://localhost:8911;
  }

  listen 443 ssl;
  ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
  include /etc/letsencrypt/options-ssl-nginx.conf;
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = www.example.com) {
        return 301 https://$host$request_uri;
    }

    if ($host = example.com) {
        return 301 https://$host$request_uri;
    }

    listen 80;
    server_name example.com www.example.com;
    return 404;
}

Thanks

@imdev

Do you see any network issues like closing connections prematurely?

Are there any logs like request not found? CORS issues?

This is going to be really hard for use to diagnose because of the setup.

Would you be able to share a link to the deployed app – even in a DM?