WebFaction
Community site: login faq

I currently host a django project on apache. I use the shared nginx to serve static media.

I would love to continue hosting the django app on apache, but use nginx to serve protected media using x-accel-redirect. Is this even possible or would I have to host django on nginx to achieve this? I know I can use x-sendfile on apache but just considering my options.

asked 08 May '16, 17:14

Keni
112
accept rate: 0%


You can't configure our front-end Nginx server to serve protected media using x-accel-redirect with a static-only app (or symlink).

You would need to either:

  • Serve your media from your Django app's Apache, or
  • Run a custom Nginx on the back-end to serve your media, and proxy your Django app's Apache through it (or run some other back-end server for your Django app, like gunicorn or uwsgi).
permanent link

answered 09 May '16, 18:45

seanf
12.2k31836
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×905
×224
×186
×3
×2

question asked: 08 May '16, 17:14

question was seen: 1,592 times

last updated: 09 May '16, 18:45

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM