[SOLVED] Installing WonderCMS with Ubuntu, CloudPanel and Nginx

Welcome to the WonderCMS community. Anything goes, except for support requests.
Post Reply
Matt5
Posts: 5
Joined: Tue Nov 12, 2024 12:03 pm

[SOLVED] Installing WonderCMS with Ubuntu, CloudPanel and Nginx

Post by Matt5 »

I'm new to WonderCMS, Ubuntu, CloudPanel and Nginx. I had just installed Ubuntu and CloudPanel on my VPS. Then I installed WonderCMS, but it didn't work. Here's how I fixed the problems:

1. .user.ini had the wrong path to source files.

2. .htaccess didn't work because I am using Nginx.

Go to the manage sites section for your website on CloudPanel. Check out Vhost. I made the following changes to the last server section in Vhost:

#try_files $uri $uri/ /index.php?$args;
index index.php index.html;

#########################################################
# Disable directory listing
autoindex off;

# Disable server signature
server_tokens off;

# Rewrite rules
location / {
# Check if the file or directory does not exist
try_files $uri $uri/ /index.php?page=$uri&$args;

if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?page=$1 last;
}

# Block access to certain files
if ($request_uri ~* "^/database\.js$") {
return 403;
}
if ($request_uri ~* "^/cache\.json$") {
return 403;
}
}
#########################################################

Basically, I got Grok AI to translate .htaccess into language that Nginx could understand. Then I just needed to figure out where to put it.

Everything seems to be working now.
Matt5
Posts: 5
Joined: Tue Nov 12, 2024 12:03 pm

Re: Installing WonderCMS with Ubuntu, CloudPanel and Nginx

Post by Matt5 »

Looks like the Nginx configuration part was covered on the page below. It never came up in my Google searches.

NGINX server config · WonderCMS/wondercms Wiki · GitHub
https://github.com/WonderCMS/wondercms/ ... ver-config
Post Reply