taco-nginx

Bash script that runs a service and forwards a subdomain to it using nginx when it listens to $PORT

  • 所有者: mafintosh/taco-nginx
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

taco-nginx

Bash script that runs a service and forwards a subdomain to it using nginx when it listens to $PORT

npm install -g taco-nginx

We recommend using latest stable nginx (>1.8.0). If you are on Ubuntu LTS for example you may need to do this:

add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx

Usage

First write a service (in any language) similar to this

var http = require('http')
var server = http.createServer(function (req, res) {
  console.log('Got request!', req.url)
  res.end('hello world\n')
})

server.listen(process.env.PORT, function () {
  console.log('Server is listening...')
})

Assuming the above file is called server.js and you have nginx running you can now do

taco-nginx --name my-service node server.js

taco-nginx will now spawn node server.js, wait for it to listen to the port specified in
$PORT and then have nginx route requests to my-service.* to it.

If you don't specify --name it will see if you have a package.json and use the name field

taco-nginx node server.js # uses name from package.json

For a full list of options run

taco-nginx --help

License

MIT

主要指標

概覽
名稱與所有者mafintosh/taco-nginx
主編程語言Shell
編程語言Shell (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2015-04-19 19:38:43
推送於2019-01-26 16:21:01
最后一次提交2019-01-26 17:20:52
發布數23
最新版本名稱v1.12.1 (發布於 2019-01-26 17:20:52)
第一版名稱v1.0.0 (發布於 2015-04-19 12:45:33)
用户参与
星數101
關注者數4
派生數4
提交數56
已啟用問題?
問題數5
打開的問題數2
拉請求數2
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?