flash網站設計(Centos6下利用nginx)

方案二:利用nginx+uwsgi發佈flask參考:https://www.cnblogs.com/vijayfly/p/6290773.html思路:修改uwsgi的ini配置文件,把http換為socket就可以瞭。Nginx的配置文件在/etc/nginx/config/config.d/下面。利用nginx監聽的9000端口http協議訪問,讓後利用socket協議,轉發到uwsgi監聽的8001端口上,讓後通信就可以瞭。兩個配置文件uwsig.ini文件[uwsgi]# manage.py文件所在目錄chdir = /root/flaskcallable = app# flask文件名wsgi-file= server5.py# 進程數processes = 2# 使用5001端口socket = 127.0.0.1:5001# 日志輸出目錄daemonize = /root/flask/flask.logpidfile = project-master.pidstats = 127.0.0.1:9191default.conf文件server {listen 9000;server_name localhost;charset utf-8;access_log /root/flask/access.log;error_log /root/flask/error.log;client_max_body_size 100M;location / {include uwsgi_params;uwsgi_pass 127.0.0.1:5001;uwsgi_param UWSGI_PYHOME /usr/bin/python3;uwsgi_param UWSGI_CHDIR /root/flask;uwsgi_param UWSGI_SCRIPT server5:app;}}uwsgi uwsig.iniService nginx startService nginx retart #stopKillall -9 uwsigps -ef|grep nginxps -ef|grep uwsignetstat -tunlp|grep nginxnetstat -tunlp|grep uwsignginx的權限問題(13: Permission denied)解決辦法補充問題:有時啟動nginx,運行後有問題,查看log日志四、SELinux設置為開啟狀態(enabled)的原因。4.1、查看當前selinux的狀態。1. /usr/sbin/sestatus4.2、將SELINUX=enforcing 修改為 SELINUX=disabled 狀態。1. vi /etc/selinux/config2. #SELINUX=enforcing3. SELINUX=disabled4.3、重啟生效。reboot。1. reboot

本文出自快速备案,转载时请注明出处及相应链接。

本文永久链接: https://kuaisubeian.cc/48926.html

kuaisubeian