I have set up an Ubuntu 20.04 LEMP server with Wordpress, and am used some tutorials to help me configure Nginx. As of now, I have things functioning flawlessly, but in multiple Ubuntu "LEMP Server + Wordpress" tutorials, I noticed a single inconsistency in Nginx location block directives, and would like an explanation on the differences between each Nginx location directive:
In 1) Linuxbabe's LEMP Wordpress tutorial, he instructs to use the following location directive in my Nginx virtual host:
location / {
try_files $uri $uri/ /index.php;
}
This broke things (the buttons wouldn't actually logout/empty-cart) with my Woo Commerce "Account Logout" button, as well as my Woo Commerce "Empty Cart" button, so it was not a solution for me.
In 2) this Devpress LEMP Wordpress tutorial he instructs to use the following location directive in my Nginx virtual host:
location / {
try_files $uri $uri/ /index.php?$args;
}
This fixed my Woo Commerce "Logout" and "empty-cart" buttons, and made them actually function and do what they are supposed to do.
In 3) this Digitalocean LEMP Wordpress tutorial he instructs to use the following location directive in my Nginx virtual host:
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
This ALSO fixed my Woo Commerce "Logout" and "empty-cart" buttons, and made them actually function and do what they are supposed to do.
So my question is, what is the difference between the
location / {
try_files $uri $uri/ /index.php;
}
and
location / {
try_files $uri $uri/ /index.php?$args;
}
and
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location directives in Nginx when using Wordpress with Woo Commerce?
Could you please elaborate and let me know why one of these broke Wordpress and two of them fixed it? Which one should I actually be using?