redbird: Basic https lets encrypt setup not working as expected
Hi!
I tried this very basic https setup — following the readme as closely as possible — but it isn’t working for me… The domain gets redirected to https as expected, and the certificates seem to be in order, but it isn’t proxying the https url to the app running.
What am I doing wrong?
Setup:
const proxy = require('redbird')({
port: 80,
xfwd: false,
letsencrypt: {
path: __dirname + '/certs',
port: 9999
},
ssl: {
http2: true,
}
});
proxy.register('rijkvanzanten.nl', 'http://146.185.154.137:3000', {
ssl: {
letsencrypt: {
email: 'rijkvanzanten@me.com',
production: true,
}
}
});
Proxy stack trace:
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Initializing letsencrypt, path /root/certs, port: 9999","time":"2017-03-31T10:50:33.806Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Listening to HTTPS requests on port undefined","time":"2017-03-31T10:50:33.882Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Started a Redbird reverse proxy server on port 80","time":"2017-03-31T10:50:33.884Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Getting Lets Encrypt certificates for rijkvanzanten.nl","time":"2017-03-31T10:50:33.888Z","v":0}
2|proxy | {"0":false,"1":"created middleware","name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Lets encrypt debugger","time":"2017-03-31T10:50:34.194Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"from":{"protocol":"http:","slashes":true,"auth":null,"host":"rijkvanzanten.nl","port":null,"hostname":"rijkvanzanten.nl","hash":null,"search":null,"query":null,"pathname":"/","path":"/","href":"http://rijkvanzanten.nl/"},"to":{"protocol":"http:","slashes":true,"auth":null,"host":"146.185.154.137:3000","port":"3000","hostname":"146.185.154.137","hash":null,"search":null,"query":null,"pathname":"/","path":"/","href":"http://146.185.154.137:3000/","sslRedirect":true,"useTargetHostHeader":false},"msg":"Registered a new route","time":"2017-03-31T10:50:34.201Z","v":0}
2|proxy | {"1":"checkAsync found existing certificates","name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Lets encrypt debugger","time":"2017-03-31T10:50:34.207Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Using cached cert for rijkvanzanten.nl","time":"2017-03-31T10:50:34.294Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Renewal of rijkvanzanten.nl in 59 days","time":"2017-03-31T10:50:34.296Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Proxying rijkvanzanten.nl/ to 146.185.154.137:3000/","time":"2017-03-31T10:52:00.003Z","v":0}
2|proxy | {"name":"redbird","hostname":"node-2","pid":3882,"level":30,"msg":"Redirecting rijkvanzanten.nl/ to https://rijkvanzanten.nl/","time":"2017-03-31T10:52:00.006Z","v":0}
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 30 (14 by maintainers)
Just put
ssl: { port: 443 }to your main redbird call (not when registering a route), see this example basing on @rijkvanzanten example:That’s it.