Facter.add(:nginx_version) do
  setcode do
    if Facter.value('kernel') != 'windows' && Facter::Util::Resolution.which('nginx')
      nginx_version = Facter::Util::Resolution.exec('nginx -v 2>&1')
      %r{nginx version: nginx\/([\w\.]+)}.match(nginx_version)[1]
    end
  end
end

Facter.add(:nginx_version) do
  setcode do
    if Facter.value('kernel') != 'windows' && Facter::Util::Resolution.which('nginx')
      nginx_version = Facter::Util::Resolution.exec('nginx -v 2>&1')
      %r{nginx version: (nginx|openresty)\/([\w\.]+)}.match(nginx_version)[2]
    end
  end
end

--- 
+++ 
@@ -2,7 +2,7 @@
   setcode do
     if Facter.value('kernel') != 'windows' && Facter::Util::Resolution.which('nginx')
       nginx_version = Facter::Util::Resolution.exec('nginx -v 2>&1')
-      %r{nginx version: (nginx|openresty)\/([\w\.]+)}.match(nginx_version)[2]
+      %r{nginx version: nginx\/([\w\.]+)}.match(nginx_version)[1]
     end
   end
 end
Revert "Prevent custom fact from complaining when openresty is installed"
