Skip to content

Commit

Permalink
fix(docs): enhance server configuration instructions for FAssets back…
Browse files Browse the repository at this point in the history
…end and frontend removing nginx
  • Loading branch information
fassko committed Dec 13, 2024
1 parent 9a664d5 commit 691abd9
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions docs/fassets/guides/1-deploy-fassets-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,26 @@ You can obtain the `xrp_rpc` for the XRP Ledger, `btc_rpc` for Bitcoin, and `dog

## Configure the Server

:::danger
To access the FAssets admin interface, you need to configure the server to route requests to the frontend and backend.

When configuring the NGINX server for FAssets, ensure all **security measures** are implemented to safeguard your system. Exposing the FAssets backend can lead to severe vulnerabilities.
### Backend Configuration

Allow your server to access the URL `fasset-backend`:

1. Route requests from `/fasset-backend` to the backend service (default port `4000`).
2. Rewrite the path from `/fasset-backend/` to `/api/`.
3. Forward necessary headers to the backend for proper communication.

### Frontend Configuration

Route requests from the frontend to the backend service:

1. Route requests from `/` path to the frontend service running on the desired port (default port `3000`).
2. Forward the Host header to the frontend service for proper handling.

:::warning

When configuring the server for FAssets, ensure all **security measures** are implemented to safeguard your system. Exposing the FAssets backend can lead to severe vulnerabilities.

- **Never expose the FAssets agent interface (`/fasset-backend`) to the public network**.
- As a rule of thumb, restrict access to the backend **only** within the local network.
Expand All @@ -190,21 +207,6 @@ When configuring the NGINX server for FAssets, ensure all **security measures**

:::

Set up the FAssets backend and frontend access by configuring the NGINX server.

```plaintext
location /fasset-backend { # use BACKEND_URL
rewrite /fasset-backend/(.*) /api/$1 break;
proxy_set_header Host $http_host;
proxy_pass http://localhost:4000; # use BACKEND_PORT
}
location / { # use FRONTEND_URL
proxy_set_header Host $http_host;
proxy_pass http://localhost:3000; # use FRONTEND_PORT
}
```

## Start the FAssets Agent

Start the FAssets agent using the Docker infrastructure by running the following command:
Expand Down

0 comments on commit 691abd9

Please sign in to comment.