nginx - Why can't the deployed Flask application be accessed using domain name?
巴扎黑
巴扎黑 2017-05-16 17:15:52
0
1
407

Deploy your own flask application on AWS. The AWS system is Ubuntu 14.04
The deployment plan is uwsgi+nginx

But after deployment, you can only use AWS’s public DNS (ec2-xx-xxx-xxx-xxx.ap-northeast-
1.compute.amazonaws.com:8000) For access, domain names cannot be used for access.
When using a domain name to access, the browser prompts Gateway Timeout

uwsgi uses the command line to start,
nginx.conf file is as follows:

server{
    listen      8000;
    server_name www.xxx.com;

    location /{

            include uwsgi_params;
            params_pass http://127.0.0.1:8000;
    }
    location /sttic{
            alias /home/xxx/weblog/app/static;
}
}

www.xxx.com is the domain name that has been purchased, and the resolution of AWS public IP has been set up.
How do I change the settings so that I can use the domain name for access? ?

巴扎黑
巴扎黑

reply all(1)
某草草

I use nginx to bind the domain name. Then nginx listens on the port and then uses gunicorn to start the flask application and go to the corresponding port to implement the domain name binding www.anaf.cn

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!