V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Achilless
V2EX  ›  问与答

关于 Python 中捕获异常的问题

  •  
  •   Achilless · 2019-04-22 17:48:11 +08:00 · 657 次点击
    这是一个创建于 1822 天前的主题,其中的信息可能已经有所发展或是发生改变。

    关于 django 项目,在 nginx 上配置阿里云 oss 作为 media 存储路径的问题,nginx.conf 需要怎么配置?

    Achilless
        1
    Achilless  
    OP
       2019-04-22 17:50:05 +08:00
    # blog_nginx.conf

    # the upstream component nginx needs to connect to
    upstream django {
    server unix://opt/uwsgitest/NewBlog/blog.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 pandacoder.top; # substitute your machine's IP address or FQDN
    charset utf-8;

    # max upload size
    client_max_body_size 75M; # adjust to taste

    # Django media
    location /media {
    alias /opt/uwsgitest/media_root; # your Django project's media files - amend as required
    }

    location /static {
    alias /opt/uwsgitest/NewBlog/static_root; # your Django project's static files - amend as required
    }

    # Finally, send all non-media requests to the Django server.
    location / {
    uwsgi_pass django;
    include /opt/uwsgitest/NewBlog/uwsgi_params; # the uwsgi_params file you installed
    }
    }
    这是现在的配置,media 那里需要修改什么呢,oss 地址是 http://pandacoderblog.oss-cn-shanghai.aliyuncs.com
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5285 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 09:12 · PVG 17:12 · LAX 02:12 · JFK 05:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.