Background:
Server: Nginx
File location: /Users/{my_username}/web-nginx/drupal
Reason:
Since I used composer to install the Drupal, the html location is at
/Users/{my_username}/web-nginx/drupal/web/
But nginx will direct other links other than homepage to /Users/{my_username}/web-nginx/
Solution:
change nginx.conf
find the nginx config file location
nginx -t
add try_files
location / {
root /Users/workmac/documents/web-nginx;
index index.html index.htm index.php;
# Shark added on 2nd May 2022
try_files $uri /drupal/web/index.php?$query_string;
}