Module executed w/o directive in config

Maxim Dounin mdounin at
Fri Jan 4 05:38:08 UTC 2019


On Thu, Jan 03, 2019 at 08:46:30AM -0800, Mark Sellers wrote:

> I am building a simple module that does a uri rewrite (not using 
> the rewrite module). The module directive is fastimg_rewrite 
> with no parameters.
> I build the code, including the module.
> When attempt to access any url, I get an error in the log:
> *1 rewrite or internal redirection cycle while internally 
> redirecting to "/images/bar/index.html”
> Funny thing is, I have not added the directive to my config file 
> yet!
> Q1: Directive not in config - why is my module executing?

It is the module which decides what to do, and whether to do 
anything without any directives in the configuration, or not.  
That is, check your code.

> Q2: What does this error  message indicate? I do want to redirect to “/images/bar/index.html”!!

The message indicates that there were too many redirects, and 
nginx decided to stop it.  Most likely, your code redirects all 
requests, including already redirected ones, and this is what 
causes the problem.

Maxim Dounin

More information about the nginx-devel mailing list