Default nginx config for virtual servers does not work with wordpress using /postname/ styled permalinks

Using a new installation of Virtualmin, installed with --minimal and --bundle LEMP on a virtual machine AND/OR Using an installation of Virtualmin installed with --bundle LEMP on a VPS AND THEN Using default virtual server creation AND THEN Using the Script Installer for WordPress AND THEN Switching permalinks from default to /postname/ (what most people do):

The error occurs that subpages do not load. A Server (and not a Wordpress) 404 is received.

This is fixed by the following change to the conf in /etc/nginx/sites-available FROM:

fastcgi_param HTTPS $https; location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/php-nginx/154120111920698.sock/socket; } listen 45.33.55.213:443 default_server ssl;

TO:

fastcgi_param HTTPS $https; location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/php-nginx/154120111920698.sock/socket; } listen 45.33.55.213:443 default_server ssl;

(Note the additional location directive)

It would be good to add this to the default skel file for virtual servers. Also, there is no way to address this file in the web gui as there is for the main config - this should be added.

Status: 
Active