Created
November 26, 2012 11:51
-
-
Save abulte/4147841 to your computer and use it in GitHub Desktop.
nginx vhost php
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
server { | |
listen 80; ## you can put ip’s or localhost here. Or change the port. | |
server_name benchmark.maboiteprivee.fr; | |
server_name_in_redirect off; | |
access_log /var/log/nginx/benchmark.access.log; | |
error_log /var/log/nginx/benchmark.error.log; | |
index index.php index.html index.htm default.html default.htm; | |
root /var/www/benchmark; | |
location / { | |
# First attempt to serve request as file, then | |
# as directory, then fall back to index.php | |
if (-f $request_filename) { | |
expires 30d; | |
break; | |
} | |
if (!-e $request_filename) { | |
rewrite ^(.+)$ /index.php?q=$1 last; | |
} | |
} | |
location ~ .*\.php$ | |
{ | |
include /etc/nginx/fastcgi_params; ##Includes our fastcgi setup | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment