Created
February 23, 2011 08:47
-
-
Save highruned/840183 to your computer and use it in GitHub Desktop.
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 80; ## listen for ipv4 | |
server_name mysite.com; | |
access_log /var/log/nginx/localhost.access.log; | |
location / { | |
root /home/myuser/mysite/www; | |
index index.php; | |
if (-e $request_filename) { | |
break; | |
} | |
set $test_var true; | |
if ($request_method = POST) { set $test_var false; } | |
if ($http_X_Requested_With !~ XMLHttpRequest) { set $test_var false; } | |
if ($test_var = true) { | |
rewrite ^([^.|]*[^/])$ $1/ permanent; | |
} | |
rewrite ^(.*)$ /index.php?q=$1 last; | |
} | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME /home/myuser/mysite/www$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment