Skip to content

Instantly share code, notes, and snippets.

@arch-jslin
Created March 23, 2010 12:12
Show Gist options
  • Save arch-jslin/341102 to your computer and use it in GitHub Desktop.
Save arch-jslin/341102 to your computer and use it in GitHub Desktop.
#Dokuwiki_Nginx_PHP_test
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
upstream php_fcgi {
server 127.0.0.1:9000;
}
upstream thin {
server 127.0.0.1:3001;
}
access_log C:/nginx/logs/access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name todo.localhost;
access_log C:/nginx/logs/todo.access.log main;
location / {
if (-f $request_filename) {
access_log off;
rewrite_log off;
expires 30d;
break;
}
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
if (!-f $request_filename) {
proxy_pass http://thin;
break;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name wiki.localhost;
access_log C:/nginx/logs/wiki.access.log main;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root C:/local_gitrepo/www/dokuwiki;
}
rewrite ^(/)_media/(.*) $1lib/exe/fetch.php?media=$2 last;
rewrite ^(/)_detail/(.*) $1lib/exe/detail.php?media=$2 last;
rewrite ^(/)_export/([^/]+)/(.*) $1doku.php?do=export_$2&id=$3 last;
location / {
root C:/local_gitrepo/www/dokuwiki;
index index.php;
if (!-f $request_filename) {
rewrite ^(/)(.*)?(.*) $1doku.php?id=$2&$3 last;
}
}
location ~ \.php$ {
fastcgi_pass php_fcgi;
fastcgi_param SCRIPT_FILENAME C:/local_gitrepo/www/dokuwiki/$fastcgi_script_name;
include fastcgi_params;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment