Permalink
Browse files

httpでアクセスされた際の転送先URLを環境ごとに切り分け

  • Loading branch information...
1 parent e29b9b5 commit b371575061f3d808566a9ed89876a29e451ed49f @nsyee nsyee committed Nov 9, 2012
Showing with 7 additions and 2 deletions.
  1. +1 −1 config/production.coffee
  2. +6 −1 lib/middleware/index.js
View
@@ -3,7 +3,7 @@ module.exports =
host: "websocket.syaberi-house.com"
port: 3000
ssl:
- port: 443
+ port: 4430
key: 'certs/2012-syaberi-private.key'
cert: 'certs/ca.cer'
cookieSecret: 'xZQWzsaY8fZWFnVltP1Y'
View
@@ -12,7 +12,12 @@ exports.ssl = function(req, res, next) {
if (host.indexOf(':') > -1) {
host = host.split(':')[0];
}
- return res.redirect('https://'+host+':'+port+req.path);
+ if (process.env.production) {
+ return res.redirect('https://'+host);
+ }
+ else {
+ return res.redirect('https://'+host+':'+port+req.path);
+ }
}
return next();
};

0 comments on commit b371575

Please sign in to comment.