Here is my code (starting with line 35):
location /
{
index index.php;
root /home/body;
if ($request_filename !~ (js|css|images|robots\.txt|index\.php.*) ) {
rewrite ^/(.*)$ /index.php/$1 last;
}
}
Here is the error:
[emerg]: unknown directive "location" in /opt/nginx/conf/nginx.conf:35
Can anyone help how to fix this? Thanks in advance.
Ensure that location directive located inside of server block: