Resolve Error 404 slug/url Nginx Webuzo on VPS Server

Resolve Error 404 slug/url Nginx Webuzo on VPS Server

By Reggi, 23 Dec 2022

Changing the webserver in the vps panel from Apache to Nginx using webuzo make the website permalinks that you have set custom will be an error not found 404 (The requested URL was not found on this server) when accessed by slug/url in the browser.

First solution is to add 1 Configuration command to common file.

Open file using Terminal, PuTTY or you can use SFTP, Access Common Files at:

/usr/local/apps/nginx/etc/conf.d/common

Then type in terminal vim /usr/local/apps/nginx/etc/conf.d/common or nano /usr/local/apps/nginx/etc/conf.d/common if is not working, You have to log in as root. Type in terminal with sudo.full code with sudo vim /usr/local/apps/nginx/etc/conf.d/ then press/type/input “i”. For the nano editor type: sudo nano /usr/local/apps/nginx/etc/conf.d/.

Add the command below at the bottom line. Remember Add at the end of the file. not editing an existing configuration.

location / {  
try_files $uri $uri/ /index.php?q=$request_uri;  
}

Then for Vim press / type / input esc, then type :wq! . if using nano type Ctrl-X then select the option “y” to save the file.

The last step is to restart nginx on your server.

service nginx restart

If you are using webuzo, you can restart on the services menu. Then select nginx, Afterwards click on the “reload/refresh” logo. Now you can access the slug or url on your website normally without a 404 error.