How would my try_files look if I wanted to have http://mydomain/script/ instead of http://mydomain/script.php ?

Sorry I couldn't find an answer anywhere, perhaps I worded the question wrong

  • 1
    Google along the lines of "clean/pretty URLs nginx php"
    – ceejayoz
    Jul 25, 2014 at 16:23
  • 1
    Also, that's a forward slash, not a backslash.
    – DerfK
    Jul 25, 2014 at 18:12
  • I am trying to configure auto-exchanger, it seems that if the url is http://mydomain/script/ script.php would be called but if the domain is http://mydomain/script/some/extra the latter two are passed as GET requests. How can I achieve that?
    – Max
    Jul 25, 2014 at 19:24

2 Answers 2


Move your into a folder named script and rename it to be index.php

  • Not an option in my situation.
    – Max
    Jul 25, 2014 at 19:07

Is the slash at the end an absolute requirement? If not, the url http://mydomain/script would work if your try_files looked like this:

try_files "${uri}.php" $uri =404;

Not the answer you're looking for? Browse other questions tagged or ask your own question.