From 7851aec38c27ff350a1703be87985c9984bb6765 Mon Sep 17 00:00:00 2001 From: Russ Savage Date: Wed, 15 May 2024 15:57:07 -0700 Subject: [PATCH 1/3] fix: adding info about url scheme missing Signed-off-by: Russ Savage --- docs/errors/details/_err_ngrok_9009.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/errors/details/_err_ngrok_9009.md diff --git a/docs/errors/details/_err_ngrok_9009.md b/docs/errors/details/_err_ngrok_9009.md new file mode 100644 index 000000000..1ae03a206 --- /dev/null +++ b/docs/errors/details/_err_ngrok_9009.md @@ -0,0 +1,3 @@ +### Additional Information + +If you are seeing an error such as: `ERROR: Invalid configuration property value for 'http_proxy': URL scheme must be 'http' or 'https'`, this means that you have a value set for the environment variable `http_proxy` or `http_proxy_env` and that it does not include the scheme in he value. If you are trying to use a proxy with ngrok, try updating the value of the env variable to include the proper scheme. If you are not trying to use ngrok with a proxy, then you will need to unset those env values before starting ngrok. From cdae99d616f58ef10085065f1570984f2045e7a6 Mon Sep 17 00:00:00 2001 From: Russ Savage Date: Wed, 15 May 2024 16:11:44 -0700 Subject: [PATCH 2/3] feat: adding instructions for using ngrok with open vpn Signed-off-by: Russ Savage --- docs/using-ngrok-with.md | 1 + docs/using-ngrok-with/openvpn.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 docs/using-ngrok-with/openvpn.md diff --git a/docs/using-ngrok-with.md b/docs/using-ngrok-with.md index 1973f9536..c9ac9297b 100644 --- a/docs/using-ngrok-with.md +++ b/docs/using-ngrok-with.md @@ -20,6 +20,7 @@ Here you will find notes on using ngrok with particular technologies. Think we'r | [MySQL](/using-ngrok-with/mysql) | Connect to local MySQL database with ngrok | | [NGINX](/using-ngrok-with/nginx) | Learn how to configure ngrok when using it with NGINX | | [Node (npm, node.js)](/using-ngrok-with/node-js) | Work with the ngrok agent from your Node application | +| [OpenVPN Connect](/using-ngrok-with/openvpn) | Use ngrok to connect to an OpenVPN server running behind CGNAT | | [Outbound proxy](/using-ngrok-with/outboundProxy) | Use ngrok through an HTTP or SOCKS5 proxy | | [PosgreSQL](/using-ngrok-with/postgresql) | Connect to a local PostgreSQL server using ngrok | | [Puppet](/using-ngrok-with/puppet) | Manage the ngrok Agent using Puppet | diff --git a/docs/using-ngrok-with/openvpn.md b/docs/using-ngrok-with/openvpn.md new file mode 100644 index 000000000..02a6d87fe --- /dev/null +++ b/docs/using-ngrok-with/openvpn.md @@ -0,0 +1,15 @@ +--- +title: OpenVPN +--- + +# Using ngrok with OpenVPN Connect + +A community user has created a detailed guide for configuring [Tunneling an OpenVPN server out from behind CGNAT](https://forums.openvpn.net/viewtopic.php?p=116476#p116476). + +There are a lot more details in the linked post, but the summary of how to do it with ngrok is to open a TCP tunnel to port 443, and visit the resulting TCP address and port in your browser to download the `.ovpn` file needed by OpenVPN Connect. + +```bash +ngrok tcp 443 +``` + +From there, you will need to use a text editor to manually edit the downloaded `.opvn` file to change the port from 443 to the random TCP address port provided by ngrok. Then follow the standard steps to import the profile to your OpenVPN Connect software and you should be able to connect to your VPN as normal. From 3f0f6134f6b265bd64599f2d8f162f6fb812cc7b Mon Sep 17 00:00:00 2001 From: Russ Savage Date: Thu, 16 May 2024 10:08:27 -0700 Subject: [PATCH 3/3] fix: updating wordpress instructions Signed-off-by: Russ Savage --- docs/using-ngrok-with.md | 2 +- docs/using-ngrok-with/wordpress.md | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/using-ngrok-with.md b/docs/using-ngrok-with.md index c9ac9297b..547de158d 100644 --- a/docs/using-ngrok-with.md +++ b/docs/using-ngrok-with.md @@ -22,7 +22,7 @@ Here you will find notes on using ngrok with particular technologies. Think we'r | [Node (npm, node.js)](/using-ngrok-with/node-js) | Work with the ngrok agent from your Node application | | [OpenVPN Connect](/using-ngrok-with/openvpn) | Use ngrok to connect to an OpenVPN server running behind CGNAT | | [Outbound proxy](/using-ngrok-with/outboundProxy) | Use ngrok through an HTTP or SOCKS5 proxy | -| [PosgreSQL](/using-ngrok-with/postgresql) | Connect to a local PostgreSQL server using ngrok | +| [PostgreSQL](/using-ngrok-with/postgresql) | Connect to a local PostgreSQL server using ngrok | | [Puppet](/using-ngrok-with/puppet) | Manage the ngrok Agent using Puppet | | [Python](/using-ngrok-with/python) | Learn how to integrate with your Python application | | [RDP](/using-ngrok-with/rdp) | Use ngrok with Windows Remote Desktop Protocol (RDP) | diff --git a/docs/using-ngrok-with/wordpress.md b/docs/using-ngrok-with/wordpress.md index 74d147fe8..fe0159c90 100644 --- a/docs/using-ngrok-with/wordpress.md +++ b/docs/using-ngrok-with/wordpress.md @@ -38,3 +38,13 @@ This is using the the last hop in the `X-Forwarded-For` header to set `REMOTE_AD If you are using a different header for the original client IP, or multiple forwarding proxies, you will need to adjust this code accordingly. ::: + +# Troubleshooting + +If you are seeing an error about too many redirects (`TOO_MANY_REDIRECTS`), you may also need to add the following to your `wp-config` file as noted in [this issue](https://github.com/ngrok/ngrok/issues/3#issuecomment-2115490539): + +```php +if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) { + $_SERVER['HTTPS'] = 'on'; +} +```