首先目标机器需要安装python nginx uwsgi,其次,需要给Nginx写配置文件,大体内容如下,
具体内容可见 http://blog.cn2p.com/web-server/nginx-uwgsi-python.html 比较具体。
server {
#修改监听端口
listen 80;
#修改域名
server_name zone4j.com;

#301重定向
if ($host != ‘zone4j.com’) {
rewrite ^/(.*)$ http://zone4j.com/? permanent;
}

#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;

#动态内容,将http协议转uWSGI协议,转发给uWSGI处理
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8023;
}

#静态内容nginx直接处理
location ~.*(html|css|js|gif|jpg|jpeg|png|bmp|ico|txt)$ {
root /var/www/html;
}

#404
error_page 404 /404.html;
location = /404.html {
root /var/www/html;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
然后用Uwsgi执行server.py 文件(必须在项目的根目录文件下),命令如下 uwsgi_python3 -s 0.0.0.0:8080 --file server文件的绝对路径

最新文章

  1. 【Git】error: RPC
  2. 如何在latex 中插入EPS格式图片
  3. 【翻译svg教程 】svg 的坐标系统
  4. Could not obtain information about Windows NT group/user 'xxxx\xxxx', error code 0x5
  5. jquery工具类函数
  6. [ACM_动态规划] 最长上升子序列(LIS)
  7. poj1631Bridging signals(最长单调递增子序列 nlgn)
  8. js中的相等与不等运算
  9. .NET Linq/MVC/架构
  10. Relax信息学题库须知
  11. String 经常用法最优算法实现总结 (二)
  12. Windows Server2012R2 安装 SharePoint 2013 的必备组件
  13. javascript 跨域 的几种方法
  14. FTP 150 Opening BINARY mode data connection for MLSD 读取目录列表失败
  15. 安卓开发之Room实体定义数据
  16. SAP SQVI 快速浏览器
  17. PHP从入门到精通(三)
  18. oracle 之 创,增,删,改操作
  19. vue-12-渲染函数 & JSX
  20. css outline实践研究

热门文章

  1. 函数式编程Map()&Reduce()
  2. 【C51】单片机定时器介绍
  3. [LeetCode]题解(python):078 Subsets
  4. 【转】使用git、git-flow与gitlab工作
  5. http://blog.csdn.net/pi9nc/article/details/23169357
  6. box_shadow
  7. Chrome控制台调试工具用法
  8. Android设计模式源码解析之外观模式(Facade)
  9. Java Lock ReentrantLock ReentrantReadWriteLock
  10. shell中引用其他脚本的方法