Joomla SEF links and Virtualmin with Nginx

I am struggling for a long time how to enable SEF links on Joomla installed on VPS with Virtualmin and Nginx web server. Since googling “virtualmin joomla ngnix” doesn’t offer reasonable answers, I decided to share what I did here.

So, Joomla is installed properly, but whenever you click any link, if SEF links with or without rewrite are enabled in global configuration of Joomla, you would get Nxinx 404 page. To fix this do the following:

  1. Login to Virtualmin and go Webmin > Servers > Nginx Web Server.

  2. Click Edit Configuration Files button.

  3. Locate this block of code:

location ~ .php$ {
try_files $uri =404;
fastcgi_pass unix:/var/php-nginx/14918980478094.sock/socket;

and add this just below it:

location / {
try_files $uri $uri/ /index.php?$args;

  1. Click Save

  2. Go to Virtualmin > Servers Status and click Restart button for Nginx Webserver.

Joomla SEF links will start working normally after this in with enabled or disabled rewrite mode in global Joomla configuration.

Best regards,