Nginx配置微信小程序校验
- Centos7的配置
- Ubuntu 的配置
情况说明
:工作中开发环境,前端需要接入微信小程序认证,进入Nginx配置文件进行配置,记录过程
Centos7的配置
# 版本详情
CentOS Linux release 7.7.1908 (Core)
nginx version: nginx/1.16.1
# 进入nginx子配置文件
cd /etc/nginx/
vim wechat_auth.conf
server {
listen 80;
server_name ;
location / {
default_type text/html;
return 200 "6831c2a15d3d103c6a1ff356b22b5";
}
error_page 500 502 503 504 /;
location = / {
root /usr/share/nginx/html;
}
}
Ubuntu 的配置
# 版本详情
Linux version 4.14.105-19-0012 (root@) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC))
nginx version: nginx/1.14.0 (Ubuntu)
vim /etc/nginx/
# Virtual Host Configs
##
server {
listen 80;
server_name ;
location / {
default_type text/html;
return 200 "6831c2a15d3d103c6a1ff356b22b5";
}
}
include /etc/nginx//*.conf;
include /etc/nginx/sites-enabled/*;
配置完成后进入腾讯云负载均衡配置,域名
+/
,加入后端realServer