Skip to content

Commit c5c69d3

Browse files
committed
creating headers
1 parent 96f93a6 commit c5c69d3

1 file changed

Lines changed: 30 additions & 17 deletions

File tree

Examples/Nginx/README.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,36 @@
22

33
## Implementation
44

5-
NOTE: The following implementation steps have been developed and tested using this [Docker image](https://github.com/fabiocicerchia/nginx-lua).
5+
NOTES:
6+
- The following implementation steps have been developed and tested using this [Docker image](https://github.com/fabiocicerchia/nginx-lua).
7+
- The following example uses `./usr/queueit` as the base path for storing all the Queue-it related files. Review and modify it to your needs.
68

7-
1) Copy the handler file and the following two folders from this repository to your NGINX filesystem. In the following example we will use `./usr/queueit` as the base path.
8-
* [KnownUserNginxHandler.lua](https://github.com/queueit/KnownUser.V3.Lua/blob/master/Handlers/KnownUserNginxHandler.lua) -> `./usr/queueit/KnownUserNginxHandler.lua`
9-
* [SDK](https://github.com/queueit/KnownUser.V3.Lua/tree/master/SDK) -> `./usr/queueit/SDK`
10-
* [Helpers](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Helpers) -> `./usr/queueit/Helpers`
11-
129

13-
2) Update or add the `lua_package_path` configuration option in your `nginx.conf` to include the new paths. Make sure to keep `;;` in the end which means default path:
10+
### 1. Copy the necessary files to your NGINX filesystem
1411

15-
```
16-
http {
17-
lua_package_path "./usr/queueit/?.lua;./usr/queueit/SDK/?.lua;./usr/queueit/Helpers/?/?.lua;;";
18-
}
19-
```
12+
Copy the following two folders from this repository to your NGINX filesystem:
13+
- [SDK](https://github.com/queueit/KnownUser.V3.Lua/tree/master/SDK) -> `./usr/queueit/SDK`
14+
- [Helpers](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Helpers) -> `./usr/queueit/Helpers`
15+
16+
Copy the main handler script:
17+
18+
- [Handlers/KnownUserNginxHandler.lua](https://github.com/queueit/KnownUser.V3.Lua/blob/master/Handlers/KnownUserNginxHandler.lua) -> `./usr/queueit/KnownUserNginxHandler.lua`
19+
20+
21+
### 2. Update the package paths
22+
23+
Update or add the `lua_package_path` configuration option in the `http` section of your main configuration file (typically `nginx.conf`) to include the new paths you created in Step 1. Make sure to keep `;;` in the end which means default path:
24+
25+
```
26+
http {
27+
lua_package_path "./usr/queueit/?.lua;./usr/queueit/SDK/?.lua;./usr/queueit/Helpers/?/?.lua;;";
28+
}
29+
```
30+
31+
32+
### 3. Add the Queue-it handler to a specific location
2033

21-
3) Then update the configuration file relative to the location you want to be protected by Queue-it (`conf.d/default.conf` or similar):
34+
Update the configuration file relative to the location you want to be protected by Queue-it (`conf.d/default.conf` or similar):
2235

2336
```
2437
server {
@@ -47,15 +60,15 @@ NOTE: The following implementation steps have been developed and tested using th
4760
}
4861
```
4962

50-
* Replace the following two placeholders in the above code `{CUSTOMER_ID}` and `{SECRET_KEY}` with respective values located in GO Queue-it platform.
51-
* NOTE: In this example `rewrite_by_lua_block` directive was added to default location `/` but you must decide what makes sense in your case.
63+
- Replace the following two placeholders in the above code `{CUSTOMER_ID}` and `{SECRET_KEY}` with respective values located in GO Queue-it platform.
64+
- NOTE: In this example `rewrite_by_lua_block` directive was added to default location `/` but you must decide what makes sense in your case.
5265

5366

54-
4) Provide the `integrationconfig.json`...
67+
### 4) Provide the `integrationconfig.json`...
5568

5669

5770

58-
### Request body trigger (advanced)
71+
## Request body trigger (advanced)
5972
Nginx handler (incl. Lua SDK) supports triggering on request body content. Example could be a POST call with specific item ID where you want end-users to queue up for.
6073
You will need to contact queue-it support if this functionality is needed, so it can be enabled on your GO Queue-it platform account.
6174
When enabled you also need to add extra settings to `location` in `conf.d/default.conf`:

0 commit comments

Comments
 (0)