开发者

nginx : unknown directive "location"

Here is my code (startin开发者_StackOverflow中文版g 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:

http {
...
    server {
        ...
        location ...
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜