You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pagespeed.apache.org by GitBox <gi...@apache.org> on 2021/02/24 21:04:16 UTC

[GitHub] [incubator-pagespeed-ngx] JialuZhang commented on issue #1679: pagespeed with load balancer (nginx) and front-end (apache)

JialuZhang commented on issue #1679:
URL: https://github.com/apache/incubator-pagespeed-ngx/issues/1679#issuecomment-785382925


   @salvoaranzulla 
   
   In your posted configuration,
   ```
   <Location /pagespeed_admin>
       RewriteEngine Off
       SetHandler pagespeed_global_admin
       AuthType Basic
       AuthName "Restricted Area"
       AuthUserFile "path/auth/.digest_pw"
       Require valid-user
   </Location>
   ```
    the line "RewriteEngine Off“ is a silent misconfiguration. This means adding it to your system will not change any system behavior.
   "RewriteEngine Off" is introduced by Apache to explicitly disable all "RewriteRule" and "RewriteCond".
   That is to say, if you include multiple "RewriteRule" and "RewriteCond" parameters in your configuration, then instead of commenting them all, you can explicitly set “RewriteEngine Off” to disable all "RewriteRule".
   
   More importantly, the default value of “RewriteEngine" is already an "off", so adding “RewriteEngine off" is quite unnecessary and it may cause confusion to users.
   
   Since herein there is no "RewriteRule", deleting “RewriteEngine Off” would be ideal.
   
   Related Apache source code snippet:
   ```
   run_rewritemap_programs(server_rec *s , apr_pool_t *p){
   if (conf->state == ENGINE_DISABLED) { // usage of "RewriteEngine"
     return APR_SUCCESS; // early return
   rewritemap_program(...); // usage of "RewriteRule" 
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org