-
-
Save mihkels/5003597 to your computer and use it in GitHub Desktop.
Pretty URLs for Silex micro-framework using Nginx. Added GET query parameters support. I prefer to run ngnix server virtual host configurations on none standard ports because it requires zero configuration in hosts file.
This file contains 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
server { | |
listen 8080; | |
server_name localhost; | |
access_log /var/log/nginx/website.access_log; | |
error_log /var/log/nginx/website.error_log; | |
root /path/to/silex/web/; | |
index index.php; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location ~* \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment