Skip to content
基于 django2.0 快速实现一个产品分享的 WEB 应用
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
apps
docs
nginx
settings
static
staticfiles
template
utils
vendor
.dockerignore
.gitignore
.travis.yml
Dockerfile
README.md
django_uwsgi.ini
django_uwsgi.py
manage.py
manage_prod.py
requirements.txt
start_nginx.sh
start_prod.sh
start_server.sh
urls.py
user.json
wsgi.py

README.md

productaste

基于 django2.0 快速实现一个产品分享的 WEB 应用

Build Status

课程地址: https://www.haimaxy.com/course/m12jop/

每节课的源码和TAG是同步的,比如第5节课对应的源码就是TAGlesson5对应的源码。

课程介绍

构建 Nginx 镜像

首先确保已经安装Docker,进入nginx目录,将下面的pt.django.conf文件内部的proxy_pass更改为你本地的Django服务地址

server {
    listen 80;
    location / {
        proxy_pass http://192.168.31.9:8000;
        proxy_redirect default;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $server_name;
    }
}

然后执行下面的镜像构建命令:

$ docker build -t mynginx:v1 .
You can’t perform that action at this time.