No Nginx, Node Only
- Static
- Proxy
- Redirect
- Concat
- Sendfile
- Status Only
- 404/4xx/5xx
- Slash Safe
- Hostnames
- Test
- Log
- More from nginx...
Boot from any conf file under shell:
$ npm i -g n0gx ## install
$ n0gx n0gx-conf 8111 ## json/js file, port
// example/n0gx-conf.js
module.exports = {
'localhost': {
'/wxtopic/': ['proxy', 'http://localhost:9113'],
'/blog/': ['proxy', 'http://localhost:8080/blog'],
'/blog_online/': ['concat', 'http://fritx.me/blog'],
'/': ['static', './example/static']
},
'*': ['sendfile', './example/static/404.html'],
'4xx': ['status', 400],
'5xx': ['status', 500]
}
// or as a node module
var n0gx = require('n0gx')
var app = n0gx(conf)
app.listen(8111, function(e){/**/})