Background: Previously used Ngrok service hung up
Setting up the Environment Ubuntu Server 16.04 LTS 64-bit
Install Git
sudo apt-get install build-essential golang mercurial git
Get Source code
git clone https://github.com/tutumcloud/ngrok.git ngrok
To generate a replacement certificate
cd ngrokNGROK_DOMAIN="ngrok.itcuc.cc"openssl genrsa -out base.key 2048openssl req -new -x509 -nodes -key base.key -days 10000 -subj "/CN=$NGROK_DOMAIN" -out base.pemopenssl genrsa -out server.key 2048openssl req -new -key server.key -subj "/CN=$NGROK_DOMAIN" -out server.csropenssl x509 -req -in server.csr -CA base.pem -CAkey base.key -CAcreateserial -days 10000 -out server.crtcp base.pem assets/client/tls/ngrokroot.crt
Compile source (Generate client)
sudo make release-server release-client
Build a client under Windows
GOOS=windows GOARCH=amd64 make release-client
Start the service
sudo ./bin/ngrokd -tlsKey=server.key -tlsCrt=server.crt -domain="ngrok.itcuc.cc" -httpAddr=":8081" -httpsAddr=":8082"
Configure Domain Name resolution
Image.png
Configure Nginx Proxy
Join in the nginx.conf
server { listen 80; server_name *.ngrok.itcuc.cc ngrok.itcuc.cc; 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:8081; proxy_set_header X-Nginx-Proxy true; proxy_set_header Connection ""; proxy_pass http://127.0.0.1:8081; } }
Reload Nginx
Verifying the installation
Open the http://ngrok.itcuc.cc/in the browser, if the tunnel ngrok.itcuc.cc:8081 not found means the installation is ready
Installing the Client
Download the 5th step of the saved Windows client
Create a new Ngrok configuration file in the same directory, name it casually, for example ngrok.conf
Adding code to the configuration file
server_addr: ngrok.itcuc.cc:4443trust_host_root_certs: false
New bat file, adding code
cd %cd%ngrok -config=ngrok.cfg -subdomain=wxtest 8080
Subdomain is the domain name and port you want to use
No more.