title: Debugging Apache/Django/WSGI Bad Request (400) Error then aliasing sub-path
body: <p>I have a django projet running on domain example.com juste fine.
  I want to Alias one particular app to example2.com but, when I disable django Debug, I keep getting Bad Request (400) Error.</p>
  
  <p>I use django 1.7.7 with python 2.7.9 on debian jessie. example.com and example2.com are both served by apache 2.4.10 with WSGI module 4.3.0.</p>
  
  <p>In apache global scope configuration I have :</p>
  
  <pre><code>WSGIDaemonProcess tracking user=www-data group=www-data processes=2 threads=15  python-path=/path/to/projects/tracking/ display-name=wsgi-django-tracking
  </code></pre>
  
  <p>In example.com vhost I have:</p>
  
  <pre><code>WSGIScriptAlias / /path/to/projects/tracking/tracking/wsgi.py
  WSGIProcessGroup tracking
  &lt;Directory /path/to/projects/tracking/tracking/&gt;
          &lt;Files wsgi.py&gt;
              Require all granted
          &lt;/Files&gt;
  &lt;/Directory&gt;
  </code></pre>
  
  <p>In example2.com vhost I have (note the <strong>/myapp</strong> on at the end of both paramater of the WSGIScriptAlias instruction):</p>
  
  <pre><code>WSGIScriptAlias /myapp /path/to/projects/tracking/tracking/wsgi.py/myapp
  WSGIProcessGroup tracking
  &lt;Directory /path/to/projects/tracking/tracking/&gt;
          &lt;Files wsgi.py&gt;
              Require all granted
          &lt;/Files&gt;
  &lt;/Directory&gt;
  </code></pre>
  
  <p>In django settings I have:</p>
  
  <pre><code>ALLOWED_HOSTS = ["example.com", "example2.com"]
  </code></pre>
  
  <p>With <code>DEBUG=True</code> everything works great. When I set <code>DEBUG=False</code>, example.com keep working but when I try to access <a href="http://example2.com/myapp" rel="nofollow">http://example2.com/myapp</a> all I get is :</p>
  
  <pre><code>Bad Request (400)
  </code></pre>
  
  <p>Nothing usefull shows up in <code>/var/log/apache2/error.log</code> nor <code>/var/log/apache2/access.log</code> so I'am a little confused.</p>
  
  <p><strong>Thank you for your help.</strong></p>