小程序人脸识别代理配置文件
1.微信小程序测试环境反向代理配置
准备工作:
https 域名。
企业认证的微信小程序账号。
反向代理服务器。
域名要求:
Url 路径不能包含以下三个路径
/DSPLivenessWeb/
/DSPMessageReceiver/
/DSPDataSourceSimulator/
反向代理配置(以 nginx 为例):
#模块路径
location ~ /DSPLivenessWeb/ {
#proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Request-Id $request_id;
proxy_pass https://dsptest.cpcn.com.cn;
client_max_body_size 40m;
client_body_buffer_size 40m;
}
#模块路径
location ~ /DSPMessageReceiver/ {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Request-Id $request_id;
proxy_pass https://dsptest.cpcn.com.cn;
client_max_body_size 40m;
client_body_buffer_size 40m;
}
#模块路径
location ~ /DSPDataSourceSimulator/ {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Request-Id $request_id;
proxy_pass https://dsptest.cpcn.com.cn;
client_max_body_size 40m;
client_body_buffer_size 40m;
}
2.微信小程序生产环境反向代理配置
准备工作:
https 域名。
企业认证的微信小程序账号。
反向代理服务器。
域名要求:
Url 路径不能包含以下三个路径
/DSPLivenessWeb/
/DSPMessageReceiver/
/faceid/lite
反向代理配置(以 nginx 为例):
#模块路径
location ~ /DSPLivenessWeb/ {
#proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Request-Id $request_id;
proxy_pass https://authentication.cpcn.com.cn;
client_max_body_size 40m;
client_body_buffer_size 40m;
}
#模块路径
location ~ /DSPMessageReceiver/ {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Request-Id $request_id;
proxy_pass https://authentication.cpcn.com.cn;
client_max_body_size 40m;
client_body_buffer_size 40m;
}
#验证路径
location /faceid/lite {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Request-Id $request_id;
proxy_pass https://authentication.cpcn.com.cn;
client_max_body_size 40m;
client_body_buffer_size 40m;
proxy_ssl_session_reuse off;
proxy_ssl_server_name on;proxy_ssl_name $proxy_host;
proxy_ssl_protocols TLSv1.2;
}