9

I was trying to install Activecollab as per the instructions here.

My vhost config for nginx is 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;
    }

}

Output of 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

I am getting error

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

Any help is appreciated.

9
  • What happens when you run nginx -t? Oct 26, 2017 at 15:29
  • @TarunLalwani its working, I am able to see my other websites. nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    – niksmac
    Oct 27, 2017 at 3:33
  • where exactly are you getting the error you have specified? Also please add nginx -V output to your question Oct 27, 2017 at 5:05
  • @TarunLalwani see my edit.
    – niksmac
    Oct 27, 2017 at 7:07
  • you didn't update about where you are seeing this error? Can you please elaborate that? Oct 27, 2017 at 7:20

2 Answers 2

2

As discussed over chat and teamviewer debug session. There is a flag REDIRECT_CHECK in config.php for activecollab. You need to disable this redirection by defining this name in config

define('REDIRECT_CHECK',false);

Also you should change below part of nginx config from

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;
}

to

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; 
}
2

With the help of Tarun I managed to resolve this. What we did is

  1. Confirmed that this has nothing to do with nginx and rules
  2. Disabled the REDIRECT_CHECK in configuration files.

Now it seems to be working fine.

5
  • Added a detailed answer with our findings Nov 4, 2017 at 9:45
  • @TarunLalwani up voted and bounty issued, btc shall follow.
    – niksmac
    Nov 4, 2017 at 14:37
  • @TarunLalwani are you rich now? :D
    – niksmac
    Apr 3, 2022 at 4:41
  • The BTC never followed, but those who learn and share always are rich :-) Apr 3, 2022 at 6:22
  • @TarunLalwani long time :D
    – niksmac
    Apr 3, 2022 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.