You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Examples/Nginx/README.md
+35-12Lines changed: 35 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,37 @@
2
2
3
3
## Implementation
4
4
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.
6
8
7
-
Copy [KnownUserNginxHandler.lua](https://github.com/queueit/KnownUser.V3.Lua/blob/master/Handlers/KnownUserNginxHandler.lua) and folders ([SDK](https://github.com/queueit/KnownUser.V3.Lua/tree/master/SDK) and [Helpers](https://github.com/queueit/KnownUser.V3.Lua/tree/master/Helpers)) incl. their content to your NGINX filesystem (in the following example we have added it to `usr/queueit`).
8
9
9
-
Then update/add `lua_package_path` in your `nginx.conf` to include the new path (keep `;;` in the end which means default path):
10
+
### 1. Copy the necessary files to your NGINX filesystem
11
+
12
+
Copy the following two folders from this repository to your NGINX filesystem:
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:
### 3. Add the Queue-it handler to a specific location
33
+
34
+
Update the configuration file relative to the location you want to be protected by Queue-it (`conf.d/default.conf` or similar):
35
+
18
36
```
19
37
server {
20
38
location / {
@@ -44,15 +62,21 @@ server {
44
62
}
45
63
}
46
64
```
47
-
In this example `rewrite_by_lua_block` have been added to default location `/` but you must decide what makes sense in your case.
48
-
Especially excluding any static content you don't want queue-it protection triggering on. This could be images (.png, .jpg), style (.css) and pages (.html).
49
65
50
-
Please note the comments in the code about providing `integrationconfig.json` ([read more](https://github.com/queueit/KnownUser.V3.Lua#1-providing-the-queue-configuration)) and replacing `CUSTOMER_ID` and `SECRET_KEY` with correct credentials located in GO Queue-it platform.
66
+
Replace the following two placeholders in the above code `{CUSTOMER_ID}` and `{SECRET_KEY}` with respective values located in GO Queue-it platform.
67
+
68
+
NOTE: In this example `rewrite_by_lua_block` directive was added to default location `/` but you must decide what makes sense in your case. In the specific, excluding any static content you don't want queue-it protection triggering on. This could be images (.png, .jpg), style sheets (.css) and pages (.html).
69
+
70
+
71
+
### 4) Provide the configuration file
51
72
52
-
### Request body trigger (advanced)
53
-
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.
54
-
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.
55
-
When enabled you also need to add extra settings to `location` in `conf.d/default.conf`:
73
+
The above code requires you to provide the `integrationconfig.json` file which contains the configuration you create on the Queue-it GO platform ([more info here](../../README.md#1-providing-the-queue-configuration)). There are various ways to provide this file. Please read the [specific documentation here](../../Documentation/README.md).
74
+
75
+
76
+
## Request body trigger (advanced)
77
+
The Nginx handler (incl. Lua SDK) supports triggering on request body content. An example could be a POST call with specific item ID where you want end-users to queue up for.
78
+
For this to work, you will need to contact queue-it support, so it can be enabled on your GO Queue-it platform account.
79
+
Once enabled, you will need to add these extra settings to your configuration:
0 commit comments