- mqtt cluster building
Installation (with script for ubuntu upstart, systemd for other linux)
description "nginx http daemon"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/local/nginx/sbin/nginx
env PIDFILE=/var/run/nginx.pid
# Needed to allow Nginx to start, however, the wrong PID will be tracked
expect fork
# Test the nginx configuration (Upstart will not proceed if this fails)
pre-start exec $DAEMON -t
# Ensure nginx is shutdown gracefully
# Upstart will be tracking the wrong PID so the following is needed to stop nginx
post-stop exec start-stop-daemon --stop --pidfile $PIDFILE --name nginx --exec $DAEMON --signal QUIT
# Start Nginx
exec $DAEMON
rtmp {
server {
listen 1935;
application live {
live on;
allow publish 127.0.0.1;
}
application dash {
live on;
allow publish 127.0.0.1;
dash on;
dash_path /tmp/dash;
}
}
}
upstream app_server {
server unix:/tmp/gunicorn.sock fail_timeout=0;
# For a TCP configuration:
# server 192.168.0.7:8000 fail_timeout=0;
}
server {
location /live {
proxy_buffering off;
add_header Cache-Control no-cache;
}
#location /stream {
# proxy_buffering off;
# add_header Cache-Control no-cache;
#}
location / {
try_files $uri @proxy_to_app;
#root html;
#index index.html index.htm;
}
location @proxy_to_app {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://app_server;
}
}
- reverse proxy with docker
- reverse proxy docker with incron
- dynamic reverse proxy with Dnsmasq
- Ansible comprehensive blog
- Nginx load balancing and reverse proxy blog
- HAproxy + Nginx + Webservice text
- Nginx tuning for python
description "Asterisk"
author "Jun HU"
start on runlevel [2345]
stop on runlevel [!2345]
# need sleep and waiting for other services .... important
pre-start exec sleep 10
#console output
respawn
exec /usr/sbin/asterisk -G sudo -g -f
> gunicorn -w 1 -b unix:/tmp/gunicorn.sock service:app
Consul, has multiple components, but as a whole, it is a tool for discovering and configuring services in your infrastructure.
- another way to dockerize the application
- nginx reverse proxy automation