关于 Python 中捕获异常的问题

2019-04-22 17:48:11 +08:00
 Achilless

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

658 次点击
所在节点    问与答
1 条回复
Achilless
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

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/557608

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX