Current location - Quotes Website - Collection of slogans - How to build a local WeChat applet server?
How to build a local WeChat applet server?
This paper mainly introduces the relevant information about the implementation method of building a local WeChat applet server, hoping to help everyone through this article, so that everyone can easily build their own WeChat applet server. Friends in need can refer to it, hoping to help everyone.

Implementation method of building WeChat applet server locally

Now the development needs to buy a server, and the price is still a bit expensive. You can build a server at a small cost to develop small programs, blogs and so on.

1. domain name (archived)

2. Free registration in Alibaba Cloud/. The well-known /PKI-validation/fileauth.txt) access. Please refer to how to configure domain name authorization verification.

Third, configure local nginx (mainly because the https configuration of Apache is too complicated)

Download certificate file

image.png

Configure the nginx.conf file in nginx, and put the certificate in the conf/cert directory, with specific code.

Server {

Listen to 443;

server _ name 1 1. 168. 1. 150;

Ssl open;

Root "d:/works/wamp";

Character set utf-8;

Index index.html index.htm;

SSL _ cert cert/2 142968697 10097 . PEM; # Replace with your file

SSL _ cert _ key cert/2 142968697 10097 . key; # Replace with your file

ssl _ session _ timeout 5m

Ssl _ ciphers ecdhe-RSA-AES128-GCM-sha256: ecdhe: ecdh: AES: high:! NULL:! Anul: MD5:! ADH:! RC4;

Ssl _ protocol tlsv1tlsv1.1tlsv1.2;

ssl _ prefer _ server _ ciphers on

Location/{

Root "d:/works/wamp";

Index index.html, index.htm and index.php;

proxy _ pass http:// 1 1. 168. 1. 150:808 1;

}

} 4. Configure the intranet mapping of peanut shells.

note:

The mapping of peanut shell can't be set to 80-port mapping (I haven't found the reason either, and the customer service feedback is to set a custom port).

After success, the address of the foreign visit.

After the last successful configuration, the required effect!