Created
September 20, 2012 12:14
-
-
Save stevepop/3755551 to your computer and use it in GitHub Desktop.
Nginx Vhost Config For Frameworks
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
Since I am using Nginx as a web server, I have included the virtual host configuration below as it took me quite a while to understand Nginx setup and how it handles rewrite rules. | |
Virtual Site config for the Silex Tutorial | |
server { | |
listen 80; | |
server_name silextut.local; | |
root /mnt/hostnfs/silextut/web; | |
index index.php; | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
location / { | |
if (-f $request_filename) { | |
expires max; | |
break; | |
} | |
rewrite ^(.*) /index.php last; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment