V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
careofzm
V2EX  ›  Python

django swagger docs 有一个坑

  •  
  •   careofzm · 2018-03-29 11:03:52 +08:00 · 3010 次点击
    这是一个创建于 2191 天前的主题,其中的信息可能已经有所发展或是发生改变。
    最近在写项目,搭建了新的服务, 以前都是使用 ip 直接请求的, 后来加上了域名,发现 docs 请求的文档都是, 本地的 ip, 后来在网上一查发现原来,需要在 nginx 中加入参数 proxy_set_header,就可解决:
    server {
    listen 80;
    server_name ******.com;
    location / {
    proxy_set_header Host $host;
    }
    }
    2 条回复    2018-03-30 10:20:17 +08:00
    ifoolish
        1
    ifoolish  
       2018-03-29 18:56:56 +08:00 via iPhone
    好巧,我上周也发现并解决了这个问题🤓,我怎么就没想到要发个贴呢
    fanhaipeng0403
        2
    fanhaipeng0403  
       2018-03-30 10:20:17 +08:00
    mark
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1535 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:58 · PVG 07:58 · LAX 16:58 · JFK 19:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.