Q:

how to add links to view nginx error logs from within virtualmin?

i was wondering this, then found someone else wondering it too (at that stage with no reply)
https://www.virtualmin.com/node/24417
when you switch from apache to nginx you dont get the same option in virtualmin server "Logs & Reports" section to view nginx's error logs
well it couldn't be that hard to add right ?...

A:

well what do you know, i worked it out (well a quick hack, not as good as the real thing but it works.)
edit virtual-server-lib-funcs.pl
(for me in debian in was in /usr/share/webmin/virtual-server )
(check your nginx log path is the same)
add this around line 11091 after the bandwidth button is added:
#nginx error log

            push(@rv, { 'mod' => 'syslog',
             'title' => 'Nginx Error Log',
               'desc' => 'Nginx Error Log',
                'page' => "save_log.cgi?view=1&file=/var/log/virtualmin/".$d->{'dom'}."_error_log",
              'cat' => 'logs',
              });

#nginx error log 

now it wont show up straight away, as these links are cached, so you can wait of for a reload by going to line 10786:
local $crv = &get_links_cache($ckey, $v);
if ($crv) {
   return @$crv;
  }

change if($crv){ to if(0){
save, upload, refresh virtualmin, your new link's should be visible, now undo this change and re-upload

