redirect all http request actions to https
http://stackoverflow.com/questions/2068418/whats-the-difference-between-a-302-and-a-307-redirect
This commit is contained in:
parent
f0d9198223
commit
d28b746d90
|
@ -131,7 +131,7 @@ var https = require('spdy');
|
|||
function redirectHttp() {
|
||||
http.createServer(LEX.createAcmeResponder(lex, function redirectHttps(req, res) {
|
||||
res.setHeader('Location', 'https://' + req.headers.host + req.url);
|
||||
res.statusCode = 302;
|
||||
res.statusCode = 302; // use 307 if you want to redirect requests with POST, DELETE or PUT action.
|
||||
res.end('<!-- Hello Developer Person! Please use HTTPS instead -->');
|
||||
})).listen(80);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue