【发布时间】:2015-07-01 17:17:31
【问题描述】:
我想将 http://localhost:9000/images 和 http://localhost:9000/rest 代理到 https://remotehost/images 和 https://remotehost/rest 但我都收到错误 500。我究竟做错了什么?如何调试这个? 这是我的配置:
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
proxies: [
{
context: '/images',
host: remotehost,
port: 443,
https: true,
changeOrigin: true,
xforward: false,
rejectUnauthorized: false
}
],
livereload: {
options: {
open: true,
base: [
'.tmp',
'<%= yeoman.app %>'
],
middleware: function (connect, options) {
if (!Array.isArray(options.base)) {
options.base = [options.base];
}
// Setup the proxy
var middlewares = [require('grunt-connect-proxy/lib/utils').proxyRequest];
// Serve static files.
options.base.forEach(function(base) {
middlewares.push(connect.static(base));
});
// Make directory browse-able.
var directory = options.directory || options.base[options.base.length - 1];
middlewares.push(connect.directory(directory));
return middlewares;
}
}
},
我试图调试这个正在运行的 grunt serve --debug 错误我没有得到关于为什么会出现这个错误的额外信息。 谢谢! https://github.com/gruntjs/grunt-contrib-connect/issues/176
【问题讨论】:
-
你解决了这个问题吗?
-
我想我更新了 NodeJS 或 Grunt....