微信小程序使用網絡相關的API有
嚴格要求
,只支持域名而且須要Https證書。
服務使用springboot,8082端口。
經過nginx 將 https://law.loadpeople.com 反向代理到 http://law.loadpeople.com:8082,並增長SSL證書。
#http重寫到https
server {
listen 80;
server_name law.loadpeople.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
#SSL
server {
listen 443;
server_name localhost;
ssl on;
root html;
index index.html index.htm;
ssl_certificate
cert/214897222470878.pem;
ssl_certificate_key
cert/214897222470878.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
#反向代理
proxy_pass http://127.0.0.1:8082;
root html;
index index.html index.htm;
}
#文件服務器
location /files/ {
root
/home/law/upload/;
autoindex on;
}
}