Welcome! Log In Create A New Profile

Advanced

Does "location" or "server" directives belong in nginx.conf file?

Posted by walterbyrd 
Does "location" or "server" directives belong in nginx.conf file?
August 24, 2020 12:27PM
Using nginx-1.4.2 on Linux.

Trying to get nginx to work on my local linux system for a moodle install.

These are the official moodle docs for such an install.

https://docs.moodle.org/39/en/Nginx

According to these docs, there should be a "location" directive in nginx.conf. But when I try that, I get:

# cat error.log
2020/08/23 17:01:32 [emerg] 27985#27985: "location" directive is not allowed here in /etc/nginx/nginx.conf:87

Looking at the configuration files in the /etc/nginx directory, I wonder if "location" or "server" directives are supposed to be in the nginx.conf file, or maybe the sites-enabled/default or maybe sites-available/default, or some other file? I have the "location" directive at the end of the file.

Or maybe I'm supposed to put the "location" directive some other place in the nginx.conf file?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 80
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