From 25a85472678c119baa5ea84043dbbdce93178d12 Mon Sep 17 00:00:00 2001 From: angel Date: Thu, 4 Aug 2022 15:46:04 -0400 Subject: [PATCH 1/3] IA Open Resty --- src/gateway/kong-production/kong-openresty.md | 32 +++++++++++++++++-- src/gateway/reference/configuration.md | 28 ---------------- 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/gateway/kong-production/kong-openresty.md b/src/gateway/kong-production/kong-openresty.md index 075f8efd4317..41a7a6c47e64 100644 --- a/src/gateway/kong-production/kong-openresty.md +++ b/src/gateway/kong-production/kong-openresty.md @@ -1,6 +1,32 @@ --- -title: Kong Open Resty - +title: Embedding Kong in OpenResty +content-type: how-to --- -## PLACEHOLDER Kong Open Resty +## Embedding Kong in OpenResty + +If you are running your own OpenResty servers, you can embed Kong +by including the Kong Nginx sub-configuration using the `include` directive. +If you have an existing Nginx configuration, you can include the +Kong-specific portion of the configuration which is output by Kong in a separate +`nginx-kong.conf` file: + +``` +# my_nginx.conf + +# ...your nginx settings... + +http { + include 'nginx-kong.conf'; + + # ...your nginx settings... +} +``` + +Then start your Nginx instance: + +```bash +nginx -p /usr/local/openresty -c my_nginx.conf +``` + +Kong will be running in that instance as configured in `nginx-kong.conf`. diff --git a/src/gateway/reference/configuration.md b/src/gateway/reference/configuration.md index 27fcc692bf15..3ae498b08480 100644 --- a/src/gateway/reference/configuration.md +++ b/src/gateway/reference/configuration.md @@ -291,34 +291,6 @@ You can then start Kong with: kong start -c kong.conf --nginx-conf custom_nginx.template ``` -## Embedding Kong in OpenResty - -If you are running your own OpenResty servers, you can also easily embed Kong -by including the Kong Nginx sub-configuration using the `include` directive. -If you have an existing Nginx configuration, you can simply include the -Kong-specific portion of the configuration which is output by Kong in a separate -`nginx-kong.conf` file: - -``` -# my_nginx.conf - -# ...your nginx settings... - -http { - include 'nginx-kong.conf'; - - # ...your nginx settings... -} -``` - -You can then start your Nginx instance like so: - -```bash -nginx -p /usr/local/openresty -c my_nginx.conf -``` - -and Kong will be running in that instance (as configured in `nginx-kong.conf`). - ## Serving both a website and your APIs from Kong A common use case for API providers is to make Kong serve both a website From b179ba78d4f3d6950c6e1a77486b357003724934 Mon Sep 17 00:00:00 2001 From: angel Date: Thu, 4 Aug 2022 15:49:12 -0400 Subject: [PATCH 2/3] retitle --- src/gateway/kong-production/kong-openresty.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gateway/kong-production/kong-openresty.md b/src/gateway/kong-production/kong-openresty.md index 41a7a6c47e64..bc46398f48a7 100644 --- a/src/gateway/kong-production/kong-openresty.md +++ b/src/gateway/kong-production/kong-openresty.md @@ -1,9 +1,9 @@ --- -title: Embedding Kong in OpenResty +title: Embed Kong in OpenResty content-type: how-to --- -## Embedding Kong in OpenResty +## Embed Kong in OpenResty If you are running your own OpenResty servers, you can embed Kong by including the Kong Nginx sub-configuration using the `include` directive. From 312287e18402a3a49de5de7891a4d5e8bae8218c Mon Sep 17 00:00:00 2001 From: Angel Date: Thu, 4 Aug 2022 16:29:11 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Diana <75819066+cloudjumpercat@users.noreply.github.com> --- src/gateway/kong-production/kong-openresty.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gateway/kong-production/kong-openresty.md b/src/gateway/kong-production/kong-openresty.md index bc46398f48a7..c016361dd46c 100644 --- a/src/gateway/kong-production/kong-openresty.md +++ b/src/gateway/kong-production/kong-openresty.md @@ -5,10 +5,10 @@ content-type: how-to ## Embed Kong in OpenResty -If you are running your own OpenResty servers, you can embed Kong -by including the Kong Nginx sub-configuration using the `include` directive. +If you are running your own OpenResty servers, you can embed {{site.base_gateway}} +by including the {{site.base_gateway}} Nginx sub-configuration using the `include` directive. If you have an existing Nginx configuration, you can include the -Kong-specific portion of the configuration which is output by Kong in a separate +{{site.base_gateway}}-specific portion of the configuration which is output by {{site.base_gateway}} in a separate `nginx-kong.conf` file: ```