Skip to content

Instantly share code, notes, and snippets.

@mihkels
Forked from simonjodet/gist:2713959
Last active January 31, 2016 13:50
Show Gist options
  • Save mihkels/5003597 to your computer and use it in GitHub Desktop.
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.
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