Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

what's wrong with the following WSGI setup based on Apache 2.2, Windows and mod_wsgi 3.3? The problem is that the client gets an OK response status even visiting URLs that don't have an associated application (e.g. http://wsgi/any), instead of 404 status code.

WSGI Application Script File:

# C:\Programmi\Apache Software Foundation\Apache2.2\wsgi\scripts\app.wsgi
def application(environ, start_response):
    status = '200 OK'
    output = 'App WSGI: Hello World!'

    response_headers = [('Content-type', 'text/plain'),
                        ('Content-Length', str(len(output)))]
    start_response(status, response_headers)

    return [output]

Virtual host:

<VirtualHost *:80>
    ServerName wsgi

    WSGIScriptAlias / "C:\Programmi\Apache Software Foundation\Apache2.2\wsgi\scripts\app.wsgi"
    <Directory "C:\Programmi\Apache Software Foundation\Apache2.2\wsgi\scripts">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Host file for name resolution:

127.0.0.1    wsgi

Many thanks.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Using:

WSGIScriptAlias / ...

means send all requests for URLs under '/' to the WSGI application. In other words, every request to your site will be handled by the WSGI application.

So, there is nothing wrong as that is what you have told it to do.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.