Configuration 在nginx上部署concrete5
我有一个在apache服务器中“开箱即用”的concrete5站点。然而,我在nginx中运行它时遇到了很多麻烦 以下是我正在使用的nginx配置:Configuration 在nginx上部署concrete5,configuration,url-rewriting,nginx,concrete5,Configuration,Url Rewriting,Nginx,Concrete5,我有一个在apache服务器中“开箱即用”的concrete5站点。然而,我在nginx中运行它时遇到了很多麻烦 以下是我正在使用的nginx配置: server { root /home/test/public; index index.php; access_log /home/test/logs/access.log; error_log /home/test/logs/error.log; location / { #
server {
root /home/test/public;
index index.php;
access_log /home/test/logs/access.log;
error_log /home/test/logs/error.log;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ index.php;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
# pass the PHP scripts to FastCGI server listening on unix socket
#
location ~ \.php($|/) {
fastcgi_pass unix:/tmp/phpfpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
我能够获得主页,但内部页面有问题。内部页面显示“拒绝访问”。可能重写不起作用,实际上我认为它是直接查询并试图执行php文件,而不是通过具体的调度程序
我在这里完全迷路了
提前感谢您的帮助 将配置更改为:
server {
root /home/test/public;
index index.php;
access_log /home/test/logs/access.log;
error_log /home/test/logs/error.log;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.php/$request_uri;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
# pass the PHP scripts to FastCGI server listening on unix socket
#
location ~ \.php($|/) {
set $script $uri;
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
}
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_intercept_errors on;
fastcgi_pass unix:/tmp/phpfpm.sock;
}
location ~ /\.ht {
deny all;
}
}
多亏了宿醉和他提供的错误,它才起作用
我仍然不清楚我做错了什么,也许nginx专家可以帮助我理解