Reputation: 16198
I have a bottle application (specifically, homu) which I want to deploy on a server.
The traditional way to run this application is to just run the program (eg python whatever.py
), without any server integration. The application is stateful and updates its state by listening to the github webhooks api. It also has a configuration panel that bottle delivers.
Whilst it is able to recover from a crash, this requires a lot of GitHub API requests (which get throttled), so it's preferable to have it running continuously.
Now, I know how to daemonize a bottle application, but this requires running it as a separate program running on a separate port from nginx. I'd like to have nginx delegate certain paths to the running bottle application.
How do I do this?
(Alternatively, a way for me to set it up so that nginx is responsible for keeping it running is nice too)
Upvotes: 0
Views: 781
Reputation: 16198
One way to do this would be to reverse-proxy it.
location /foo/bar {
proxy_pass http://localhost:someport/;
}
and then run the bottle application on someport
Upvotes: 1