Reverse Proxy

Configure the proxy to intercept inbound requests

Command

stoobly-agent run --proxy-mode reverse:<URL>

Configuring /etc/hosts

To use a reverse proxy with a specific domain name, you need to modify your /etc/hosts file to point the domain to localhost. This allows your system to resolve the domain name to the reverse proxy instead of the actual server.

Manual Configuration

Edit /etc/hosts (requires administrator privileges):

On Linux/macOS:

sudo nano /etc/hosts

Add entries for each domain you want to intercept:

127.0.0.1 example.com
127.0.0.1 api.example.com
::1       example.com
::1       api.example.com

On Windows:

  1. Open Notepad as Administrator

  2. Open C:\Windows\System32\drivers\etc\hosts

  3. Add the same entries as shown above

Example

If you're setting up a reverse proxy for https://api.example.com:

  1. Add to /etc/hosts:

  2. Run Stoobly with reverse proxy mode:

  3. Access the domain - requests will be intercepted:

Cleanup

Remember to remove entries from /etc/hosts when you're done testing, or comment them out by adding # at the start of each line.

circle-info

For scaffold workflows, you can use stoobly-agent scaffold hostname install --workflow <WORKFLOW_NAME> to automatically manage /etc/hosts entries for service hostnames.

Enabling HTTPS Traffic

To enable HTTPS traffic to the reverse proxy, add the following options to the run command:

Last updated

Was this helpful?