Welcome! Log In Create A New Profile

Advanced

Re: need help cleaning up user directory and php rules

June 01, 2009 05:54PM
I found this to be working. Should be faster than before but dunno. *shrugs*

Or is there a better way doing this? I'm planning to replace my
lighttpd installation with nginx using this config.

server {
listen 80;
server mahleetserver.com;
index index.php;
client_max_body_size 3m;

if ($uri ~ ^/~edho/blog) {
set $err404 /~edho/blog/index.php;
set $is_custom404 1;
}

if ($is_custom404 != 1) {
set $err404 /404.html;
}
error_page 404 $err404;

#username should only contain these letters, right?
location ~ /\~([A-Za-z\d\-_\s]+)(.*)$ {
alias /export/home/$1/public_html$2;
location ~ \.php {
#it'll be rather broken if not done this way
location ~ /\~([A-Za-z\d\-_\s]+)(.*)$ {
set $ud_user $1; set $ud_file $2;
root /export/home/$ud_user/public_html;
try_files $ud_file @404;
fastcgi_pass php-cgi;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$ud_file;
include fastcgi_params;
}
}
}

location / {
root /var/www/data;
rewrite ^/wiki/([^?]*)(?:\?(.*))? /w/index.php?title=$1&$2;
rewrite ^/wiki /w/index.php;
rewrite ^/edogawaconan/signature.jpg
/edogawaconan/signature.php;
}
location ~ \.php$ {
root /var/www/data;
try_files $uri @404;
fastcgi_pass php-cgi;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
location @404 {
return 404;
}



--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Subject Author Posted

Re: need help cleaning up user directory and php rules

edogawaconan June 01, 2009 05:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready