-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ai-community-answers
- Loading branch information
Showing
298 changed files
with
8,209 additions
and
3,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: Using nginx as a reverse proxy | ||
sidebar: Docs | ||
showTitle: true | ||
--- | ||
|
||
import RegionWarning from "../_snippets/region-warning.mdx" | ||
|
||
<RegionWarning /> | ||
|
||
You can use nginx as a reverse proxy. To do this, first create a `Dockerfile` to build a nginx container: | ||
|
||
```dockerfile | ||
FROM nginx:alpine | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
``` | ||
|
||
Next, create the `nginx.conf` file with the reverse proxy configuration. The following checks the `Referer` header to ensure the request is coming from your domain (set as `hogbook.com` in this case), then proxies the request to PostHog Cloud US. Change `us` to `eu` to proxy to our EU Cloud. | ||
|
||
```nginx.conf | ||
# The main context | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
server { | ||
listen 8080; # Set the port to 8080 | ||
server_name _; # Accept requests for any domain | ||
# Check Referer header | ||
# Change hogbook to your domain as needed to ensure requests only come from your domain | ||
set $valid_referer 0; | ||
if ($http_referer ~* "^https?://(localhost|([a-zA-Z0-9-]+)\.hogbook\.com)") { | ||
set $valid_referer 1; | ||
} | ||
if ($valid_referer = 0) { | ||
return 403; # Return forbidden if the Referer header is invalid | ||
} | ||
location /static/ { | ||
proxy_pass https://us-assets.i.posthog.com/static/; | ||
proxy_set_header Host us-assets.i.posthog.com; | ||
} | ||
location / { | ||
proxy_pass https://us.i.posthog.com/; | ||
proxy_set_header Host us.i.posthog.com; | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
In most cases, we recommend using a single project across your product, but if you want to programmatically create multiple projects, this is the endpoint for you. | ||
|
||
To get your organization ID, use the `/api/organizations/@current` endpoint or check the endpoint directly on [US Cloud](https://us.posthog.com/api/organizations/@current) or [EU Cloud](https://eu.posthog.com/api/organizations/@current). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Returns a list of projects in your organization. | ||
|
||
To get your organization ID, use the `/api/organizations/@current` endpoint or check the endpoint directly on [US Cloud](https://us.posthog.com/api/organizations/@current) or [EU Cloud](https://eu.posthog.com/api/organizations/@current). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
### Who maintains this? | ||
|
||
This is maintained by PostHog. If you have issues with it not functioning as intended, please [let us know](http://app.posthog.com/home#supportModal)! | ||
This is maintained by PostHog. If you have issues with it not functioning as intended, please [let us know](https://us.posthog.com/#panel=support%3Asupport%3Aapps%3A%3Atrue)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
## Requirements | ||
|
||
Using this requires either PostHog Cloud with the [data pipeline add-on](https://us.posthog.com/organization/billing), or a self-hosted PostHog instance running [version 1.30.0](/blog/the-posthog-array-1-30-0) or later. | ||
|
||
Self-hosting and not running 1.30.0? Find out [how to update your self-hosted PostHog deployment](/docs/runbook/upgrading-posthog). | ||
Using this requires either PostHog Cloud with the [data pipelines add-on](https://us.posthog.com/organization/billing), or a self-hosted PostHog instance running a recent version of the Docker image. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.