Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCU-2419] Open Resty #4187

Merged
merged 3 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions src/gateway/kong-production/kong-openresty.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
---
title: Kong Open Resty

title: Embed Kong in OpenResty
content-type: how-to
---

## PLACEHOLDER Kong Open Resty
## Embed Kong in OpenResty

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
{{site.base_gateway}}-specific portion of the configuration which is output by {{site.base_gateway}} 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`.
28 changes: 0 additions & 28 deletions src/gateway/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down