Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed extra conf location in template #85

Merged
merged 2 commits into from
Jul 17, 2017
Merged

Changed extra conf location in template #85

merged 2 commits into from
Jul 17, 2017

Conversation

icamys
Copy link
Contributor

@icamys icamys commented Feb 7, 2017

In version 1.9.11 there were introduced dynamic modules. With this version has appeared a new directive load_module.

To include dynamic module, such as geoip, we should specify path relative to the source directory:

load_module "modules/ngx_http_geoip_module.so";

The point here is that this directive should be included in main context before any other contexts.

For example, this config triggers error:

user www-data;
pid        /run/nginx.pid;

worker_processes  4;

events {
    ...
}

load_module "modules/ngx_http_geoip_module.so";

http {
    ...
}
...

The error text:

root@server:/home/vagrant# nginx -t
nginx: [emerg] "load_module" directive is specified too late in /etc/nginx/nginx.conf:13
nginx: configuration file /etc/nginx/nginx.conf test failed

However this config works fine:

user www-data;
pid        /run/nginx.pid;

worker_processes  4;

load_module "modules/ngx_http_geoip_module.so";

events {
    ...
}

http {
    ...
}
...

That's why I propose to lift up extra conf location in this PR.

@thomas-frantz
Copy link

lol, I didn't even see someone did this already, I can close my PR if we want.

@geerlingguy Is there something wrong with this being merged in that one of us could fix?

@geerlingguy
Copy link
Owner

I'd be happy to merge this in—please fix the conflict/rebase then I'll merge it. Thanks!

@geerlingguy geerlingguy merged commit 6962e03 into geerlingguy:master Jul 17, 2017
@geerlingguy
Copy link
Owner

Merged! It's in 2.4.0.

h3po pushed a commit to h3po/ansible-role-nginx that referenced this pull request Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants