Score:1

nginx: [emerg] "include" directive is not allowed here

cn flag

My page has a lot a redirects. I placed them all in a file redirects.conf and included it:

server {
   ...
   include redirects.conf;
}

The redirects.conf file looks like this:

rewrite  ^/[Gg]ewinnspiel/?$  https://www.facebook.com/Somepage.de?ref=ts permanent;
rewrite  ^/[Gg]ewinnspiel-[Oo]stern$  https://www.Somepage.de/ewinnspiele/Ostern permanent;
rewrite  ^/[Ff]euerwehr$  https://www.Somepage.de/feuerwehr.pdf permanent;

That works fine.

Now, I would like to split this file again. But if I place an include part1.conf; in my redirects.conf file I get:

nginx: [emerg] "include" directive is not allowed here

Documentation tells me include is allowed anywhere: http://nginx.org/en/docs/ngx_core_module.html#include

Is this no possible or am I doing something wrong?

in flag
It would be helpful to know where you want to include them.
in flag
So you have an include in an included file?
cn flag
@GeraldSchneider Thanks for the feedback. I added more context.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.