Answer the question
In order to leave comments, you need to log in
Node.js Digitalocean Ubuntu NGINX net::ERR_CONNECTION_TIMED_OUT what could be the problem?
Application on MEAN2-stack throws an error:
GET https://xx.xx.xx.xx:3000/api/check-email?email=tes... net::ERR_CONNECTION_TIMED_OUT
curl https://xx.xx.xx.xx:3000/api/check-email?email=tes...
curl: (35) gnutls_handshake() failed: An unexpected TLS packet was received.
curl xx.xx.xx.xx:3000/api/[email protected]
private baseUrl = 'https://xx.xx.xx.xx:3000/api/';
...
app.use( '/api', routesApi );
...
app.listen( 3000, 'xx.xx.xx.xx', () => {
console.log( 'Server is running' );
} );
server {
server_name helperra.com www.helperra.com;
location / {
root /helperra/client/dist;
try_files $uri $uri/ @node;
}
location @node {
proxy_pass http://xx.xx.xx.xx:3000;
proxy_redirect 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;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/helperra.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/helperra.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.helperra.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = helperra.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name helperra.com www.helperra.com;
return 404; # managed by Certbot
}
Answer the question
In order to leave comments, you need to log in
After I removed the host on the front and back, everything worked.
app.listen( port, () => {
console.log( 'Server is running' );
} );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question