alguien puede ayudar a servir una aplicación en bottle, con nginx o de cualquier manera
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Building off the article that Etel linked to, a “Hello World” Bottle app might look like: <pre> from bottle import route, run
@route(‘/hello’) def hello(): return “Hello World!”
run(host=‘0.0.0.0’, port=3000) </pre> You can set the port to anything you want. Now we can use Nginx as a reverse proxy. You Nginx configuration would look something like: <pre> upstream app_server { server 127.0.0.1:3000 fail_timeout=0; }
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 4G;
server_name your-domain.com;
keepalive_timeout 5;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app_server;
}
} </pre> Note that the upstream directive is on the same port as the Bottle app.
To get Nginx installed in the first place, check out:
https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts
anyone can help to serve an application bottle, with nginx or otherwise
We have an article on bottle here: https://www.digitalocean.com/community/tutorials/how-to-use-the-bottle-micro-framework-to-develop-python-web-apps
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.