0

I've got a nodejs based api server running on port 3000. I've created an A record for the server's ipaddress and am trying to access the api on demo.mydomain.com:3000/api/v1.

This does not seem to be working currently. Accessing via th ip address however works.

Here is my nginx config --

 server {
        listen 443;
        server_name demo.mydomain.com;
        index index.html;
        root /var/www/html/;

        location / {
          try_files $uri /$uri /index.html;
        }
      }
        server {
        listen 443;
        server_name demo.mydomain.com;
        index index.html;
        root /var/www/html/;

        location / {
          try_files $uri /$uri /index.html;
        }
      }


      server {
              listen       3000;
              server_name  demo.mydomain.com;
              location /api/v1/ {
                proxy_pass          http://localhost:3000/api/v1/;
                proxy_http_version 1.1;
                proxy_set_header    Host             $host;
                proxy_set_header    X-Real-IP        $remote_addr;
                proxy_set_header    X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_read_timeout 1800;
                proxy_connect_timeout 1800;
              }
          }
charsi
  • 167
  • 1
  • 6
  • What *does* happen when you go to the domain version? Error? Timeout? What's the output of `dig demo.mydomain.com`? – ceejayoz Feb 03 '18 at 02:01
  • @ceejayoz demo.mydomain.com works as expected. It loads my site. demo.mydomain.com:3000/api/v1 just times out. – charsi Feb 03 '18 at 02:08
  • I figured out the culprit. It is cloudflare. I turned off their HTTP proxy in DNS settings and it is now working – charsi Feb 03 '18 at 02:15
  • They don't support port 3000. Only the ones listed here.. https://support.cloudflare.com/hc/en-us/articles/200169156-Which-ports-will-Cloudflare-work-with- – charsi Feb 03 '18 at 02:15

0 Answers0