Django 开发WEB应用在ubuntu上应用部署文件

mysite_nginx.conf 配置内容

# mysite_nginx.conf
# the upstream component nginx needs to connect to
upstream django {
    # server unix:///path/to/your/mysite/mysite.sock; # for a file socket
    server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
 
# configuration of the server
server {
    # the port your site will be served on
    listen      80;
    # the domain name it will serve for
    server_name 192.168.1.247; # substitute your machine's IP address or FQDN
    charset     utf-8;
    proxy_buffer_size 1024M;
    proxy_buffers 4 1024M;
    proxy_busy_buffers_size 1024M;
    proxy_temp_file_write_size 1024M;
 
    # max upload size
    client_max_body_size 3000M;   # adjust to taste
 
    # Django media
    location /media  {
        alias /home/aa/www/media;  # your Django project's media files - amend as required
    }
 
    location /static {
        alias /home/aa/www/static; 
# your Django project's static files - amend as required
    }
 
    # Finally, send all non-media requests to the Django server.
    location / {
        uwsgi_pass  django;
        proxy_buffer_size 1024M;
	    proxy_buffers 4 1024M;
	    proxy_busy_buffers_size 1024M;
	    proxy_temp_file_write_size 1024M;
        include     /etc/nginx/uwsgi_params; # the uwsgi_params file you installed
    }
}

mysite_uwsgi.ini 配置文件

# mysite_uwsgi.ini file
[uwsgi]
 
# Django-related settings
# the base directory (full path)
chdir           = /home/aa/www/
# Django's wsgi file
module          = www.wsgi
# the virtualenv (full path)
home            = /home/aa/virtualenvs/www
 
# process-related settings
# master
master          = true
# maximum number of worker processes
processes       = 10
# the socket (use the full path to be safe
socket          = 127.0.0.1:8001
#socket          = /home/aa/www/mysite.sock
# ... with appropriate permissions - may be needed
# chmod-socket    = 664
# clear environment on exit
vacuum          = true
daemonize=/home/aa/www/uwsgi.log


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值