Nginx: Unknown Directive “Location”

This is my code (from line 35):

location /

{

index index.php;
root /home/body;

if ($request_filename !~ (js|css|images|robots\.txt |index\.php.*)) {
rewrite ^/(.*)$/index.php/$1 last;
}
}

This is an error :

[emerg]: unknown directive "location" in /opt/nginx/conf/nginx.conf:35

Anyone can help This problem? Thanks in advance.

Make sure to locate the location directive within the server block:

< p>

http {
...
server {
...
location ...
}
}< /pre>

This is my code (from line 35):

location /

{

index index.php;
root /home/body;

if ($request_filename !~ (js|css|images|robots \.txt|index\.php.*)) {
rewrite ^/(.*)$/index.php/$1 last;
}
}

This is the error:

[emerg]: unknown directive "location" in /opt/nginx/conf/nginx.conf:35

Anyone Can you help solve this problem? Thanks in advance.

Make sure to locate the location instruction in the server block:

http {< br />...
server {
...
location ...
}
}

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 4655 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.