Created
March 28, 2024 18:19
-
-
Save developertugrul/cfc6a030999711f6c66fc640fe34d13c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
try_files $uri $uri/ @extensionless-php; | |
index index.html index.htm index.php; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
location @extensionless-php { | |
rewrite ^(.*)$ $1.php last; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment