nginx下载地址:http://nginx.org/
打开文件 conf/nginx.conf
server {
listen 8081;
server_name 127.0.0.1 192.168.1.40;
location / {
root F:/file/my-fire/;
index index.html index.htm;
}
location /api/ {
proxy_pass http://0.0.0.0:7080/;
index index.html index.htm;
}
}
设置接口地址
var url = 'http://localhost:8081/api';
访问地址别在编辑器打开,在浏览器中直接输入 localhost:8081