How to config the path for the dynamic module of nginx to access?

Maxim Dounin mdounin at
Thu Dec 1 18:17:36 UTC 2016


On Thu, Dec 01, 2016 at 10:08:55AM -0800, Ya-wen Lin wrote:

> Thanks for your reply.
> I've already have
> load_module /usr/local/etc/nginx/;
> in nginx.conf
> But that "" will write out some files, I'd like to
> config the path for those generated files.
> Currently the path seems to be the working folder I start nginx service.

If you use paths in your module you are expected to handle them 
much like the nginx itself, depending on context:

- either relative to prefix, like load_module does;
- or relative to conf prefix, like include does;
- or relative to document root, like serving static files.

First two variants are usually handled at configuration parsing 
time using the ngx_conf_full_name() function.  Last one is usually 
done with the ngx_http_map_uri_to_path() function.

Maxim Dounin

More information about the nginx mailing list