关于 django 项目,在 nginx 上配置阿里云 oss 作为 media 存储路径的问题,nginx.conf 需要怎么配置?
1
Achilless OP # 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 |