Two servers configured ngrok failed to start properly?

I now have two servers, ABI B. I want to install nginx on A to help me forward requests to B server, and all domain names are bound to A server. Now I have installed the ngrok server on the B server, started successfully, and compiled the client, but I can"t connect when I start the ngrok client on my laptop:

ngrok                                                                     (Ctrl+C to quit)
                                                                                          
Tunnel Status                 reconnecting                                                
Version                       1.7/                                                        
Web Interface                 127.0.0.1:4040                                              
-sharp Conn                        0                                                           
Avg Conn Time                 0.00ms      

there is no problem with the local ngrok.cfg configuration file. I think the problem is the nginx configuration. In the past, it was possible for me to configure the ngrok, domain name on machine An and bound to the A server. The nginx configuration file for configuring yes on a server is as follows:

upstream ngrok{
        server 127.0.0.1:8000;
        keepalive 64;
}
server{
        listen 80;
        server_name *.ngrok.xxx.top;
        client_max_body_size 10m;
        access_log logs/ngrok.access.log main;
        location / {
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host  $http_host:8000;
                proxy_set_header X-Nginx-Proxy true;
                proxy_set_header Connection "";
                proxy_pass http://ngrok;
        }

}

now I am configuring on two servers, and none of the parameters have changed. The port I check ngrok listens on is:

tcp6       0      0 :::4443                 :::*                    LISTEN      13060/./ngrokd      
tcp6       0      0 :::443                  :::*                    LISTEN      13060/./ngrokd      
tcp6       0      0 :::8000                 :::*                    LISTEN      13060/./ngrokd

I wondered if I needed to listen to 4443 on A to forward all 4443 requests to server B, and then I added a new ngrok4443.conf file (this file is included in ngrok.cfg) in the nginx configuration file directory. The ngrok.cfg and ngrok4443.cfg are as follows:
ngrok.fcg

upstream ngrok{
        server 193.111.111.111:8000;
        keepalive 64;
}
server{
        listen 80;
        server_name *.ngrok.xxx.top;
        client_max_body_size 10m;
        access_log logs/ngrok.access.log main;
        location /{
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host  $http_host:8000;
                proxy_set_header X-Nginx-Proxy true;
                proxy_set_header Connection "";
                proxy_pass http://ngrok;
        }

}

ngrok4443.cfg

upstream ngrok4443{
        server 193.111.111.111:4443;
        keepalive 64;
}
server{
        listen 4443;
        server_name ngrok.xxx.top;
        client_max_body_size 10m;
        access_log logs/ngrok4443.access.log main;
        location /{
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host  $http_host:4443;
                proxy_set_header X-Nginx-Proxy true;
                proxy_set_header Connection "";
                proxy_pass http://ngrok4443;
        }
}

after the configuration above, it still cannot be started.
ngrok.cfg is configured as follows:

server_addr: "ngrok.xxx.top:4443"
trust_host_root_certs: false
tunnels:
  http:
    subdomain: "test"
    proto:
      http: "8080"

  http1:
    subdomain: "test1"
    proto:
      http: "8081"
      

now I don"t know what to do. Ask for help. Thank you!

Mar.18,2021
Menu