Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mozilla/videur
Deprecated: Lua scripts for Nginx
https://github.com/mozilla/videur
Last synced: 23 days ago
JSON representation
Deprecated: Lua scripts for Nginx
- Host: GitHub
- URL: https://github.com/mozilla/videur
- Owner: mozilla
- Archived: true
- Created: 2014-06-12T11:59:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-08-17T18:58:06.000Z (over 4 years ago)
- Last Synced: 2024-10-29T23:51:49.454Z (about 2 months ago)
- Language: Lua
- Homepage:
- Size: 68.4 KB
- Stars: 40
- Watchers: 19
- Forks: 8
- Open Issues: 8
-
Metadata Files:
- Readme: README.rst
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Videur
======Pronounced: */vidœʀ/*
***experimental project***
Videur is a Lua library for OpenResty that will automatically parse
an API specification file provided by a web server and proxy incoming
Nginx requests to that server.Videur takes care of rejecting requests that do not comply with the
specification definitions, such as:- unknown GET arguments
- bad types or out of limits arguments
- missing authorization headers
- POST body too big
- too many requests per second on a given API
- etc..To get a detailed list of rules that can be used,
look at the `Videur API Specification 0.1
document `_Installation
------------To install Videur, you need to have an OpenResty environment deployed.
Then you can run::
make install
If you have a specific Lua lib directory, you can use the **LUA_LIB_DIR** and
**LUA_TREE** options.This command will simply copy all the lua files of the Videur lib into
the OpenResty lib directory.Usage
-----Using Videur in Nginx is done in three directives.
First of all, you need to define a couple of Lua shared dicts:
- **cached_spec**, where Videur will store the API specification the backend provided
- **stats**, where Videur keeps track of the hits for its rate limiting featureThen you need to set a **spec_url** variable with the URL of the API spec.
This URL should be a JSON document as defined in the `Videur API
Specification 0.1 document `_Last, the **access_by_lua_file** directive needs to point to the
**dynamic_proxy_pass.lua** script from the Videur library.Example::
http {
lua_shared_dict cached_spec 512k;
lua_shared_dict stats 512k;server {
listen 80;
set $spec_url "http://127.0.0.1:8282/api-specs";
access_by_lua_file "dynamic_proxy_pass.lua";
}
}