GitHub - gexiangying/iislua: It brings the power of Lua scripting in your IIS. · GitHub
Skip to content

gexiangying/iislua

 
 

Folders and files

Repository files navigation

iislua

Build status Release Downloads License

It brings the power of Lua scripting in your IIS.

Install

Download MSI file from following page. (x64 version)

https://github.com/shibayan/iislua/releases

Configuration

Web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <iislua>
      <beginRequest scriptPath="C:\inetpub\beginrequest.lua" />
      <mapPath scriptPath="C:\inetpub\mappath.lua" />
    </iislua>
  </system.webServer>
</configuration>

Usage

Return status code

iis.exit(404)

Redirect

iis.redirect("http://buchizo.wordpress.com/")

Refuse http method

if iis.req.http_method() ~= "POST" then
    iis.exit(405)
end

Cross domain access control

req_headers = iis.req.get_headers()

if req_headers["Origin"] ~= nil then
    iis.resp.set_header("Access-Control-Allow-Origin", req_headers["Origin"])
end

Rewrite to other url

if iis.req.get_url() == "/" then
   iis.exec("/iisstart.htm")
end

About

It brings the power of Lua scripting in your IIS.

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

  • C++ 50.3%
  • C 47.9%
  • JavaScript 1.6%
  • Batchfile 0.2%