程序放在网站根目录下时,配置文件如下
server {
listen 80;
server_name ABC.org www.ABC.org; #你的域名
root /path/to/JNBBS/path; #论坛程序目录
index index.php;
access_log /path/to/basic/log/access.log;
error_log /path/to/basic/log/error.log;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ^~ /core/ {
deny all;
}
#其他配置
}
程序放在网站子目录下时,在Nginx配置文件中加入以下配置
server {
#其他配置
#添加JNBBS配置开始
#假设论坛程序放在abc子目录下
location /abc/ {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /abc/index.php?$args;
}
location ^~ /abc/core/ {
deny all;
}
#添加JNBBS配置结束
#其他配置
}