Thanks for the reply Graham. Since the time I wrote the initial
message, I figured out the problem: I was using nginx as the frontend,
as you point out, and sending requests to apache at 127.0.0.1:8080.
But I hadn't updated my virtualhost file to process requests to that
address.

I made the following change to get the dynamic content served
properly. In /etc/apache2/sites-available/mysite.org

<VirtualHost *> became <VirtualHost 127.0.0.1:8080>

I figured it out after going back to basics and reading up on what a
reverse proxy is and some of the syntax about nginx. Am I correct to
interpret this deployment style as an nginx server front-end that
servers media (once I configure that correctly) and proxies requests
for dynamic content upstream to apache? That makes sense to me
conceptually based on the config settings, but maybe I'm somehow
confusing things.

Now, on to fixing the serving of media.

Thanks again for the suggestions.

On Nov 12, 7:04 pm, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 13, 6:48 am, "Serdar T." <[EMAIL PROTECTED]> wrote:
>
>
>
> > Can someone offer advice on server deployment headaches involving
> > apache/mod_wsgi/nginx? I seem to be having two problems:
>
> > 1) Apache/mod_wsgi correctly serves dynamic content from a test app
> > (located in a ~/public_html directory) when the url starts with
> > "www".  But apache reverts to serving the default index.html (out of /
> > var/www) when the "www" is omitted from the url. I tried tweaking the
> > ServerAlias configs and even using Rewrite rules, but to no avail.
>
> > Ideally, I'd like apache and nginx to rerwite all urls to strip the
> > leading "www"
>
> > My server config and relevant django app files (settings.py and
> > urls.py) are athttp://dpaste.com/90308/
> > They are an adaptation of the configs from EricFlo's screencast 13
> > (http://thisweekindjango.com/screencasts/episode/21/django-ground-
> > episode-13/)
>
> What if you list all host names in single ServerAlias directive and
> not multiple.
>
>  http://httpd.apache.org/docs/2.2/mod/core.html#serveralias
>
> > 2) In addition, the admin backend doesn't work on the production
> > server (I get a 404 error) regardless of whether or not I pre-pend the
> > "www". Apache error logs stated that the sqlite database backend did
> > not have write permissions, but the 404 errors persisted even after I
> > added the permissions (chmod 755).
>
> You have:
>
>   ADMIN_MEDIA_PREFIX = '/media/'
>
> yet that doesn't appear to be where media files are being served from.
>
> Your configuration is a bit confusing with nginx in front and both
> nginx and Apache both attempting to serve static files. Suggest you
> get Apache working with static files first and ignore nginx until you
> have that working and understand how things are affected by Django
> settings for media.
>
> Graham
>
> > Any suggestions would be greatly appreciated!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to