Nodejs fail to listen port with ip address

Problem: a server behind proxy unreachable for api listening port 3050 with bedrock wordpress.

I had deployed wordpress with Trellis to my VMs. Everything is up and running perfectly. The wordpress site is accessible to the but it won’t able access through IP address like

I had setup a node api that listening on port 3050. but when I try to browse/curl it with or

Chrome is return: This site can’t be reached ; ERR_CONNECTION_REFUSED

I only able to reach the site with

I have a Nginx reverse proxy that help me route to my Proxmox VMs.

Here is the routing rules that written on my revesed proxy:

location ~* /api/ {
    client_max_body_size 500M;
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto http;
    rewrite ^/api/(.*) /$1 break;

Normally the node api should be reachable like:
but now:

I am looking for a way, that my Trellis Wordpress can be access with . I think it will help me solve the problem.

Any advise are appreciated


Trellis does not currently support using an IP address for virtual hosts, only hostnames.

1 Like

Thanks for the reply :slight_smile:

Is there any chance I can manually override it from the server?

if yes, where are the conf located?

if disallow access it with IP address doesn’t matter

if there any chance to open a custom port of the server?

It works with localhost

$ curl localhost:3061/api {"api":true}%

But external failed me

$ curl curl: (7) Failed to connect to port 3061: Connection refused

Thanks, I had found the solution

What was the solution you used?