【发布时间】:2016-04-06 09:45:42
【问题描述】:
我有一个关于代理中间件的问题
我像这样初始化浏览器同步:
gulp.task('browser-sync', function() {
files = [
'**/*.php'
];
browserSync.init(files,{
open:false,
port: 3000,
ui: {
port: 3000 + 1
},
proxy: {
baseDir: "./",
target : "http://example.com",
}
});
});
我使用 nginx 代理到http://127.0.0.1:3000
server {
listen EXTERNAL_IP:80;
server_name development.example.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
}
但是浏览器同步调用 127.0.0.1:3000 而不是 http://development.example.com 如何告诉 browser-sync 它应该调用 http://development.example.com ? 谢谢!
【问题讨论】:
标签: nginx proxy gulp middleware browser-sync