drupal-with-nginx icon indicating copy to clipboard operation
drupal-with-nginx copied to clipboard

Some links for the advanced help module don't work

Open jkounis opened this issue 11 years ago • 2 comments
trafficstars

The only advanced help links that work with these configuration files are links that match the pattern ^/help/[^/]*/README.txt$. The problem is that advanced help does not only serve files that end with README.txt. For example, the advanced help module itself has help files with the following URIs:

  • help/advanced_help/using-advanced-help
  • help/advanced_help/ini-file
  • help/advanced_help/translation
  • help/advanced_help/why-advanced-help

All of these generate 404 errors with the current Drupal 7 configuration.

I suggest the attached patch as a way to generalize the handling of advanced help URIs.


diff --git a/apps/drupal/drupal.conf b/apps/drupal/drupal.conf
index 0679bf4..bd7daa4 100644
--- a/apps/drupal/drupal.conf
+++ b/apps/drupal/drupal.conf
@@ -195,7 +195,6 @@ location / {
 
     ## Advanced Help module makes each module provided README available.
     location ^~ /help/ {
-        location ~* ^/help/[^/]*/README\.txt$ {
             ## Include the specific FastCGI configuration. This is for a
             ## FCGI backend like php-cgi or php-fpm.
             include apps/drupal/fastcgi_drupal.conf;
@@ -205,7 +204,6 @@ location / {
             ## uncomment the two lines below.
             #proxy_pass http://phpapache/index.php?q=$uri;
             #proxy_set_header Connection '';
-        }
     }
 
     ## Replicate the Apache  directive of Drupal standard

jkounis avatar Jul 22 '14 10:07 jkounis

Hello,

Thanks for your question. This has a very simple solution. Try this:

     ## Advanced Help module makes each module provided README available.
     location ^~ /help/ {
         location ~* ^/help/[^/]*/(?:advanced_help/[[:alpha:]]*|README\.txt)$ {
             ## Include the specific FastCGI configuration. This is for a
             ## FCGI backend like php-cgi or php-fpm.
             include apps/drupal/fastcgi_drupal.conf;
         }   
     }

perusio avatar Jul 22 '14 21:07 perusio

Thank you perusio. You pointed me in the right direction. Those exact location strings did not work for me, but modified versions worked. The location string you provided seems to require help//advanced_help; however, the paths I need are in the format help/advanced_help/. There is also a path help/devel/README_devel_node_access.txt that needs to work too. Finally, [[:alpha:]] did not work for me because paths have "-" and "_" characters in them.

I changed it as follows:

     ## Advanced Help module makes each module provided README available.
     location ^~ /help/ {
         location ~* ^/help/(?:advanced_help/[A-Za-z0-9_-]*|[^/]*/README[^/]*\.txt)$ {
             ## Include the specific FastCGI configuration. This is for a
             ## FCGI backend like php-cgi or php-fpm.
             include apps/drupal/fastcgi_drupal.conf;
         }   
     }

Or simply:

     ## Advanced Help module makes each module provided README available.
     location ^~ /help/ {
         location ~* ^/help/(?:advanced_help/[^/]*|[^/]*/README[^/]*\.txt)$ {
             ## Include the specific FastCGI configuration. This is for a
             ## FCGI backend like php-cgi or php-fpm.
             include apps/drupal/fastcgi_drupal.conf;
         }   
     }

jkounis avatar Jul 22 '14 22:07 jkounis