server {
listen 80;
server_name www.mydomain.com;
#root /data/Service;
charset utf-8;
access_log /usr/local/nginx/logs/www.mydomain.com.access.log main;
<span style="color: #ff0000;"># Virtual directory with PHPsupport onnginx
location ~ ^/Forum/.+\.php$ {
alias /data/Forum/;
rewrite /Forum/(.*\.php?) /$1 break;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /data/Forum$fastcgi_script_name;
include fastcgi_params;
}
location ~^/Forum($|/.*) {
alias /data/Forum/$1;
index index.php index.html index.htm;
}
# Virtual directory with PHP support on nginx – end</span>
# Virtual directory with PHP support onnginx
location ~ ^/Mantis/.+\.php$ {
alias /data/Mantis/;
rewrite /Mantis/(.*\.php?) /$1 break;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /data/Mantis$fastcgi_script_name;
include fastcgi_params;
}
location ~^/Mantis($|/.*) {
alias /data/Mantis/$1;
index index.php index.html index.htm;
}
# Virtual directory with PHP support on nginx – end
location /{
root /data/Service;
index index.php index.html index.htm;
}
#fast-cgi for php-cgi
location ~\.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /data/Service$fastcgi_script_name;
include fastcgi_params;
}
location ~\.(gif|jpg|jpeg|png|bmp|ico|rar|css|js|zip|java|jar|txt|flv|swf|mid|doc|ppt|xls|pdf|txt|mp3|wma)${
access_log off;
expires max;
}
error_page 404 /404.html;
# redirectserver error pages to the static page /50x.html
#
error_page 500 502 503504 /50x.html;
}