Welcome! Log In Create A New Profile

Advanced

Re: "server" directive is not allowed here error

June 04, 2017 06:38AM
On Sun, 2017-06-04 at 10:28 +0000, Dino Edwards wrote:
> >
> > You can't have server {} block outside http {} ( http://nginx.org/e
> > n/docs/http/ngx_http_core_module.html#server )
> >
> > So it has to be:
> >
> > http {
> > server {
> >   // whatever goes here
> >  }
> > }
>
> That can't be right, because before I used the multiple location
> directives, I didn't have http and it worked fine. Regardless, I
> followed your advice and I got the following now:
>
> nginx: [emerg] "http" directive is not allowed here in
> /usr/local/nginx/conf/sites-enabled/ server.domain.tld -ssl:1

The "http" directive is likely in your main nginx.conf.

For testing (not maintenance), you may try putting it all in one file
so you can more easily find your error. Likely, as has been suggested,
it is a misplaced curly brace ({ or }).

>
> Thanks in advance

Jim Ohlstein
Professional Mailman Hosting
https://mailman-hosting.com/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

"server" directive is not allowed here error

Dino Edwards June 03, 2017 09:40AM

RE: "server" directive is not allowed here error

Reinis Rozitis June 03, 2017 02:22PM

RE: "server" directive is not allowed here error

Dino Edwards June 04, 2017 06:30AM

Re: "server" directive is not allowed here error

Anoop Alias June 04, 2017 06:32AM

Re: "server" directive is not allowed here error

Jim Ohlstein June 04, 2017 06:38AM

RE: "server" directive is not allowed here error

Reinis Rozitis June 04, 2017 07:42AM

Re: "server" directive is not allowed here error

pbooth June 04, 2017 09:00AM

Re: "server" directive is not allowed here error

oscaretu . June 04, 2017 09:10AM

Re: "server" directive is not allowed here error

Anoop Alias June 04, 2017 09:16AM

RE: "server" directive is not allowed here error

Reinis Rozitis June 04, 2017 09:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 57
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready