gpt4 book ai didi

nginx - activecollab 5 nginx url重写不起作用

转载 作者:行者123 更新时间:2023-12-04 04:24:09 25 4
gpt4 key购买 nike

我正在尝试按照instructions here安装Activecollab。

我对Nginx的虚拟主机配置是here

server {
listen *:80;
server_name collab.example.com;
access_log /var/log/nginx/ac.access.log;
error_log /var/log/nginx/ac.error.log;

set $root_path /usr/share/nginx/html/collabs/public;
root $root_path;

index index.html index.htm index.php router.php;
charset utf-8;

if (!-e $request_filename) {
rewrite ^/assets/(.*)$ /assets/$1 last;
rewrite ^/avatars/(.*)$ /avatars/$1 last;
rewrite ^/wallpapers/(.*)$ /wallpapers/$1 last;
rewrite ^/verify-existence$ /verify.php last;
rewrite ^/proxy.php$ /proxy.php last;
rewrite ^/api/v([0-9]*)/(.*)$ /api.php?path_info=$2&api_version=$1 last;
rewrite ^$ /router.php last;
rewrite ^(.*) /router.php?path_info=$1 last;
}


location ~ ^/(assets|avatars|wallpapers)/ {
root $root_path;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}


location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_read_timeout 150;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}

}
nginx -V的输出

nginx version: nginx/1.10.3 (Ubuntu)
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads

我遇到错误

Error — URL rewriting is not enabled. Invalid URL rewrite check response:



任何帮助表示赞赏。

最佳答案

正如在聊天和teamviewer调试 session 中所讨论的。 REDIRECT_CHECK中有一个标记config.php用于activecollab。您需要通过在配置中定义此名称来禁用此重定向

define('REDIRECT_CHECK',false);

您还应该从以下更改nginx配置的一部分
if (!-e $request_filename) {
rewrite ^/assets/(.*)$ /assets/$1 last;
rewrite ^/avatars/(.*)$ /avatars/$1 last;
rewrite ^/wallpapers/(.*)$ /wallpapers/$1 last;
rewrite ^/verify-existence$ /verify.php last;
rewrite ^/proxy.php$ /proxy.php last;
rewrite ^/api/v([0-9]*)/(.*)$ /api.php?path_info=$2&api_version=$1 last;
rewrite ^$ /router.php last;
rewrite ^(.*) /router.php?path_info=$1 last;
}


location / { 
if (!-e $request_filename) {
rewrite ^/assets/(.*)$ /assets/$1 last;
rewrite ^/avatars/(.*)$ /avatars/$1 last;
rewrite ^/wallpapers/(.*)$ /wallpapers/$1 last;
rewrite ^/verify-existence$ /verify.php last;
rewrite ^/proxy.php$ /proxy.php last;
rewrite ^/api/v([0-9]*)/(.*)$ /api.php?path_info=$2&api_version=$1 last;
rewrite ^$ /router.php last;
rewrite ^(.*) /router.php?path_info=$1 last;
}
try_files $uri $uri/ /router.php?path_info=$uri&$args;
}

关于nginx - activecollab 5 nginx url重写不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46905460/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com