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;
}
}