2017-10-24 18 views
9

मैं instructions here के अनुसार ActiveCollab स्थापित करने का प्रयास कर रहा था। nginx के लिएactivecollab 5 nginx url rewrite काम नहीं कर रहा

मेरे vhost config 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:

किसी भी मदद की सराहना की हो रही है की 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; 
    } 

} 

आउटपुट है।

+0

क्या होता है जब आप 'nginx चलाने nginx config का हिस्सा नीचे बदलना चाहिए config

define('REDIRECT_CHECK',false); 

इसके अलावा में इस नाम को परिभाषित करते हुए यह पुनर्निर्देशन अक्षम करने की आवश्यकता -t'? –

+0

@TarunLalwani इसके काम कर रहा है, मैं अपनी अन्य वेबसाइटों को देखने में सक्षम हूं। 'nginx: कॉन्फ़िगरेशन फ़ाइल /etc/nginx/nginx.conf वाक्यविन्यास ठीक है – niksmac

+0

जहां आपको निर्दिष्ट त्रुटि मिल रही है? कृपया अपने प्रश्न –

उत्तर

2

चैट और टीमव्यूवर डीबग सत्र पर चर्चा के अनुसार। सक्रिय कॉलबैब के लिए config.php में ध्वज REDIRECT_CHECK है। आप आप से

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

Tarun की सहायता से मैंने इसे हल करने में कामयाब रहे। क्या हमने किया

  1. की पुष्टि की है कि इस nginx साथ कोई संबंध नहीं है और नियमों
  2. विकलांग विन्यास फाइल में REDIRECT_CHECK है।

अब यह ठीक काम कर रहा है।

+0

हमारे निष्कर्षों के साथ एक विस्तृत उत्तर जोड़ा गया –

+0

@TarunLalwani ऊपर मतदान और बक्षीस जारी, बीटीसी का पालन करेंगे। – niksmac

संबंधित मुद्दे