Coder Social home page Coder Social logo

Comments (10)

cjmayo avatar cjmayo commented on August 21, 2024

For me I think this was still OK in 1.9.15 and not working in 1.10.1.

from ngx-fancyindex.

aperezdc avatar aperezdc commented on August 21, 2024

It seems that I will need to find out in which version of Nginx things stopped working. One question: are you using fancyindex as a loadable dynamic module, or built into Nginx statically?

from ngx-fancyindex.

jarischaefer avatar jarischaefer commented on August 21, 2024

Statically

from ngx-fancyindex.

cjmayo avatar cjmayo commented on August 21, 2024

Statically also. I've checked, 1.9.15 was OK.

1.9.15 was with Fancy Index 0.3.6
1.10.1 and 1.11.2 with Fancy Index 0.4.0

from ngx-fancyindex.

tdavis avatar tdavis commented on August 21, 2024

Was about to report this. FI 0.4.0 (static) with 1.10.1 ignores index.html here, as well.

from ngx-fancyindex.

aperezdc avatar aperezdc commented on August 21, 2024

Thanks for all the comments. I'll check the changes introduced by Nginx and try to fix this issue as soon as I'm back from holidays later this week. Sorry for keeping you waiting!

from ngx-fancyindex.

aperezdc avatar aperezdc commented on August 21, 2024

I have just started adding a test suite for the module (see #47), and I am now going to add a couple of test cases which reproduce this issue. It was about time to have tests 😉

from ngx-fancyindex.

aperezdc avatar aperezdc commented on August 21, 2024

Okay, I have an explanation for this: in versions after 1.9.11 (which introduced dynamic module support) the following piece of the config file is not ran:

# XXX: Insert fancyindex module *after* index module!
#
HTTP_MODULES=`echo "${HTTP_MODULES}" | sed -e \
  's/ngx_http_index_module/ngx_http_fancyindex_module ngx_http_index_module/'`

That is because after 1.9.11 the new system for configuring modules is used. For dynamic builds I have been already able to fix the issue by setting:

ngx_module_order="$ngx_module_name
                  ngx_http_autoindex_module"

That causes the correct module order to be used when loading the module dynamically. Unfortunately for static builds the $ngx_module_order variable is ignored, and reordering $HTTP_MODULES in the way it was done before 1.9.11 does not work either. I am going through the files in auto/* in the Nginx source code to find out if some workaround could be used.

from ngx-fancyindex.

aperezdc avatar aperezdc commented on August 21, 2024

It seems that using the old-style config snippet works even in recent Nginx releases when building the module statically. The following works in all supported versions:

if [ $ngx_module_link = DYNAMIC ] ; then
   # Define $ngx_module_order and source auto/module
else
   # Manually edit $HTTP_MODULES and $NGX_ADDON_SRCS
fi

Soon I will be pushing a fix for this issue 😄

from ngx-fancyindex.

aperezdc avatar aperezdc commented on August 21, 2024

The fix is now in master, and the new tests are passing in the CI. Closing.

from ngx-fancyindex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.