w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Nginx virtual host error duplicate location "/" in /etc/nginx/vhosts/

The problem is that you have the same location defined twice, just like the error says, you need to remove this block

location / {
/wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/
/index.php?$args ;

and then delete this in the other file

try_files $uri @backend;

and put this instead

/wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri

here's the @backend location

location @backend {

Any other location should just use this same proxy location, and for the ~.php I think it can be replaced with something like this

location ~ .php$ {
  try_files @backend =404;

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.