Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit b371575061f3d808566a9ed89876a29e451ed49f 1 parent e29b9b5
@nsyee00 nsyee00 authored
Showing with 7 additions and 2 deletions.
  1. +1 −1  config/production.coffee
  2. +6 −1 lib/middleware/index.js
View
2  config/production.coffee
@@ -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
7 lib/middleware/index.js
@@ -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();
};
Please sign in to comment.
Something went wrong with that request. Please try again.