Monday, 5 June 2017

Cannot get node server to proxy to nginx on RedHat Ec2 Instance

I have a redhat Ec2 instance. And I have a simple Express App running on port 3000. I installed nginx and it is running correctly because I am able to proxy s3 buckets static sites to other subdomains I am using. However, when I try and proxy my Express app to one of my subdomains I keep getting the nginx failure page. Here is my nginx config block I am using:

server {
    listen       80;
    listen      api.subdoamin.com:80;
    server_name  api.grouve.tech;
    root         /usr/share/nginx/html;

    # Load configuration files for the default server block.
    include /etc/nginx/default.d/*.conf;

    location / {
            proxy_pass http://00.000.00.000:3000;
            expires 1y;
            log_not_found off;
            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;
    }
     error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
}



via Amen Ra

No comments:

Post a Comment