-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nginx: look for index.html in all paths ending in '/' #15
nginx: look for index.html in all paths ending in '/' #15
Conversation
Start to match the behavior of the Apache2 handling of requests that might be in the pageCache. If the filename ends with '/' try to serve filename + 'index.html The Apache2 handler also checks 'index/htm'
I'd like to see this merged into Passenger or have some feedback about what needs to be changed or why it won't get merged. Thanks |
Is this issue getting some love? I'm getting hit by the same thing. My sinatra-app on nginx/passenger: http://jawsjs.com/docs/index.html <-- works It seems I can't get it to work no matter what combination of "index index.html", "location" and "passenger_enabled" I try in my nginx.conf. |
Found this, and it seems to work: https://gist.github.com/547977 |
The code looks good. You should include an integration test though, in test/integration/nginx_tests.rb under "various features". |
It looks like I'll need to modify or create some new resources in the test/stubs/ folder in order to test tis behavior. I noticed this behavior while serving up a rails app with nginx in stand-alone mode with an index.html in a subdirectory under /public. Do you have any more suggest for the best way/place to implement this behavior test? |
perhaps it would be enough to create:
and add a test in n test/integration/nginx_tests.rb under "various features" that makes sure index.html is returned when a request is made to '/dir' and to '/dir/' |
In the integration tests we reserve a number of virtual hosts for testing purposes (1.passenger.test ... 6.passenger.test). You can use one of them if you need custom Nginx settings. Furthermore the stub app directory is recreated on every test so it's okay to put files in "#{@some_app_stub.app_dir}/public", they'll be removed after the test. |
Hi @stepheneb, there are two reasons we couldn't merge your code: we needed an accompanying test, as well as a signed contributor agreement. I just took care of writing the test (in this commit), could you sign the agreement? Thanks! |
agreement signed |
Yep, we got it, thanks! It's merge deconflicted into https://github.com/phusion/passenger/commits/PR_15 and awaiting final merge :) |
Merged to 5.0.7 |
See mailing list thread: http://groups.google.com/group/phusion-passenger/browse_thread/thread/58453ce1ea4c60c4
I'm not much of a C programmer ... so I added the bare minimum to get this working for me.
Start to match the behavior of the Apache2 handling of
requests that might be in the pageCache.
If the filename ends with '/' try to serve filename + 'index.html
The Apache2 handler also checks 'index/htm'