PREVENT INFORMATION DISCLOSURE - NGINX ON PLESK

I tried to do the changes in /etc/nginx/nginx.conf. This configuration file only contained

http {
         //some code here
         }

I tried adding the generated code to the http section.

## WP Defender - Prevent information disclosure ##
				# Turn off directory indexing
autoindex off;

# Deny access to htaccess and other hidden files
location ~ /\. {
  deny  all;
}

# Deny access to wp-config.php file
location = /wp-config.php {
  deny all;
}

# Deny access to revealing or potentially dangerous files in the /wp-content/ directory (including sub-folders)
location ~* ^/wp-content/.*\.(txt|md|exe|sh|bak|inc|pot|po|mo|log|sql)$ {
  deny all;
}
				## WP Defender - End ##

But when I restart nginx, its giving error. Kindly let me know where to make changes for Plesk based system.