Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
2 of 4
added 301 characters in body
Ivan Shatsky
  • 4.1k
  • 2
  • 10
  • 25
  1. Location you used will match only the requests containing $ symbol, that's definitely not what you want.
  2. Using the try_files directive you must specify at least one file/folder to check. The easiest way to specify the file that would fail the existence check is to specify dev/null.

So your location should look like

 location / { try_files /dev/null /index.php$is_args$args; include fastcgi.conf; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_pass unix://var/run/php/php7.3-fpm.sock; } 

or, without the try_files directive

 location / { include fastcgi.conf; fastcgi_param SCRIPT_FILENAME $document_root/index.php; fastcgi_pass unix://var/run/php/php7.3-fpm.sock; } 
Ivan Shatsky
  • 4.1k
  • 2
  • 10
  • 25