Hi. I use the vBulletin Maker Community. I just migrated from http to https recently and used the Certbot app to do that. Certbot automatically added certificates and domain redirects from http to https in the defualt.conf settings on the Nginx web server. vBulletin is embedded within the
forums directory on the root of Nginx web server.
It shows up on https when I hit the home page URL (
https://mysite.com) but when I enter the forum address (
https://mysite.com/forums) I get an error "500 Internal Server Error". (please check picture attachment)
The following error is displayed when I check the Nginx logs.
Code:
2020/03/25 08:45:03 [error] 5632#5632: *1 FastCGI sent in stderr: "PHP message: PHP Warning:
count(): Parameter must be an array or an object that implements
Countable in /usr/share/nginx/html/forums/includes/vb5/template.php(392) : eval()'d code on line 457" while reading response header from upstream,
client: 10.250.20.143, server: mysite.com, request: "GET /forums/ HTTP/1.1",
upstream: "fastcgi://127.0.0.1:9000", host: "mysite.com",
referrer: "https://mysite.com/forums/"
The settings for my Nginx are as follows :
Code:
server { ## listen for ipv4
server_name mysite.com www.mysite.com;
root /usr/share/nginx/html;
index index.php index.html index.htm;
rewrite /forums/css.php$ /forums/core/css.php last;
client_max_body_size 20M;
large_client_header_buffers 4 16k;
# log files, uncomment and set proper values
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# configuration rules
# legacy css being handled separate for performance
location = /css\.php {
rewrite ^ /core/css.php break;
}
# make install available from presentation
location ^~ /forums/install {
rewrite ^/forums/install/ /forums/core/install/ break;
}
# any request to not existing item gets redirected through routestring
location /forums/ {
if (!-f $request_filename) {
rewrite ^/forums/(.*)$ /forums/index.php?routestring=$1 last;
}
}
# make admincp available from presentation
location ^~ /forums/admincp {
if (!-f $request_filename) {
rewrite ^/forums/admincp/(.*)$ /forums/index.php?routestring=admincp/$1 last;
}
}
# login admincp codes
location ~ /forums/(?!index)[^/]+\.php$ {
if (!-f $request_filename) {
rewrite ^/forums/(.*) /forums/index.php?routestring=$1 last;
}
}
# process any php scripts, not found gets redirected through routestring
location ~ \.php$ {
# handles legacy scripts
if (!-f $request_filename) {
rewrite ^/(.*)$ /index.php?routestring=$1 break;
}
fastcgi_split_path_info ^(.+\.php)(.*)$;
try_files $fastcgi_script_name =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffers 256 16k;
fastcgi_buffer_size 32k;
fastcgi_temp_file_write_size 256k;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
upstream phpfastcgi {
# address to accept FastCGI requests. Make sure you set the right value under your fast cgi conf.
server unix:/var/run/php-fpm/php-fpm.pid;
}
server {
if ($host = www.mysite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = mysite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name mysite.com www.mysite.com;
return 404; # managed by Certbot
}
Where can the problem be? And how can I solve the problem?
My scenario specifications are as follows:
OS :
CentOS 7
PHP :
7.3
MariaDB :
10
Nginx :
1.16