微信公众号调试环境搭建
1、本机打开web服务http:localhost:8000/.
2、设置host 127.0.0.1 www.xxxxx.com.可以在电脑host文件那里设置,
用fiddler设置。
3、使用fiddler,使用手机代理到电脑上。
4、在手机微信里打开www.xxxx.com,打不开,可清除缓存或退出后重新打开。
#user nobody;
worker_processes 1;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name www.meiyuapp.com;
location ~ ^/$
{
proxy_pass http://127.0.0.1:8000;
}
location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css|xlsx|xls|ttf|woff|svg)$ {
proxy_pass http://127.0.0.1:8000;
}
location ^~ /sockjs {
proxy_pass http://127.0.0.1:8000;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 9905;
server_name localhost;
location ~ ^/$
{
root D:\project\farmer_market_api\web\H5;
index Home.html;
}
location ~ .*\.(html|htm|gif|jpg|jpeg|bmp|png|ico|txt|js|css|xlsx|xls|ttf|woff|svg)$ {
root D:\project\farmer_market_api\web\H5;
index Home.html;
access_log off;
}
location / {
proxy_pass http://192.168.0.181:10083;
access_log off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
网友评论