python 2.7 - How to call a flask application from a web browser? -



python 2.7 - How to call a flask application from a web browser? -

i have flask application works on pc. when deployed on virtual server (centos 6.5) used nginx according article: https://www.digitalocean.com/community/tutorials/how-to-deploy-flask-web-applications-using-uwsgi-behind-nginx-on-centos-6-4

i had alter port in /etc/nginx/nginx.conf because created conflict apache port (caused nginx fail start because port in use). nginx.conf is:

worker_processes 1; events { worker_connections 1024; } http { sendfile on; gzip on; gzip_http_version 1.0; gzip_proxied any; gzip_min_length 500; gzip_disable "msie [1-6]\."; gzip_types text/plain text/xml text/css text/comma-separated-values text/javascript application/x-javascript application/atom+xml; # configuration containing list of application servers upstream uwsgicluster { server 127.0.0.1:8081; # server 127.0.0.1:8081; # .. # . } # configuration nginx server { # running port hear 81; # settings by-pass static files location ^~ /static/ { # example: # root /full/path/to/application/static/file/dir; root /app/static/; } # serve static file (ex. favico) outside static dir. location = /favico.ico { root /app/favico.ico; } # proxying connections application servers location / { include uwsgi_params; uwsgi_pass uwsgicluster; proxy_redirect off; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header x-forwarded-host $server_name; } } }

my application located under 12.12.15.16/cgi-bin/my_app (the ip address here dummy).

i used next command line start app:

env/bin/uwsgi --socket 127.0.0.1:8081 --protocol=http --wsgi-file main.py --callable app

my question is: how can phone call app web browser?

thank help!

your flask app listening on port 8081 localhost connections (127.0.0.1). nginx listening on port 81 connections , piping them flask on 8081. own browser want access http://your-digital-ocean-ip:81/

python-2.7 nginx flask centos uwsgi

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -