[TOC]
## **服务器配置**
1、修改web服务器配置,以nginx为例。增加如下配置:
```
location /h5 {
try_files $uri $uri/ @router;
}
location @router {
rewrite ^.*$ /h5/index.html last;
}
```
![](https://img.kancloud.cn/81/d2/81d23245df981c452149658b5f7b5b5a_1197x575.png)
2、访问http://你的域名/h5,公众号地址链接到这个地址就行。
3、公众号配置:
域名配置:进入公众号后台->设置->公众号设置->功能设置,把域名添加 进来。如下图:
![](https://img.kancloud.cn/79/b0/79b027d29eeca4d7afb7e04e7c9bdfc6_1308x672.png)
4、支付设置:进入微信商户后台->产品中心->JSAPI支付->产品设置,如下图:添加支付授权目录https://www.xxx.com/h5/pages/order
![](https://img.kancloud.cn/9e/40/9e409225d0b50d9328f625fa8e030418_1358x615.png)