Created
November 21, 2015 18:15
-
-
Save rambo/dece72c04f0361027a2f to your computer and use it in GitHub Desktop.
Autostart and proxy to port 80 for https://github.com/tanelikaivola/lottacnc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_pass http://localhost:5002; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/init/lottacnc.conf | |
description "Start the LottaCNC Flask app on boot" | |
author "Eero af Heurlin <[email protected]>" | |
env USERNAME=lottacnc | |
env APP_DIR=/opt/lottacnc | |
# We need to bind to localhost at least | |
start on ( filesystem \ | |
and net-device-up IFACE=lo) | |
stop on shutdown | |
# Automatically Respawn: | |
respawn | |
respawn limit 99 5 | |
script | |
cd $APP_DIR | |
exec su $USERNAME -c "python run.py" | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment