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

Host file for name resolution:    wsgi

Many thanks.



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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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