加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mysite.conf 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
otfsenter 提交于 2018-09-16 18:32 . first commit
# 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 server_name; # substitute your machine's IP address or FQDN
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
charset utf-8;
gzip on;
gzip_types text/plain application/x-javascript text/css text/javascript application/x-httpd-php application/json text/json image/jpeg image/gif image/png application/octet-stream;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
# max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media/ {
alias /ur/local/project/mysite/media/; # your Django project's media files - amend as required
}
location /static/ {
alias /usr/local/project/mysite/static/;
}
# Finally, send all non-media requests to the Django server.
location / {
include uwsgi_params;
uwsgi_connect_timeout 30;
uwsgi_pass unix:/usr/local/project/mysite/uwsgi.sock;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化