improved reverse proxy example in README
@@ -158,21 +158,43 @@ Web application and API Documentation can be accessed via URLs highlighted in gr
##### Advanced configuration
You can fully customize TensorHive behaviours via INI configuration files (which will be created automatically after `tensorhive init`):
```
+~/.config/TensorHive/hosts_config.ini
~/.config/TensorHive/main_config.ini
~/.config/TensorHive/mailbot_config.ini
-~/.config/TensorHive/hosts_config.ini
```
-[(see example)](https://github.com/roscisz/TensorHive/blob/master/tensorhive/main_config.ini)
+<details>
+<summary>(see example)</summary>
+<p>
+
+[hosts_config.ini](https://github.com/roscisz/TensorHive/blob/master/tensorhive/hosts_config.ini)
+[main_config.ini](https://github.com/roscisz/TensorHive/blob/master/tensorhive/main_config.ini)
+[mailbot_config.ini](https://github.com/roscisz/TensorHive/blob/master/tensorhive/mailbot_config.ini)
+
+
+</p>
+</details>
----------------------
#### Reverse proxy setup
-TensorHive supports reverse proxy setup. To use that you have to setup api and backend servers as usual. There are 2
-added fields in main_config.ini: `url_port` and `url_schema`. This will allow full setup of the URL that will be proxied.
+Serving TensorHive through reverse proxy requires proper configuration of URL parameters in the `[api]` section of
+`main_config.ini`, including `url_schema`, `url_hostname`, `url_port` and `url_prefix`.
-Lets assume, that the backend is running on `http://localhost:5000` and api on `http://localhost:1111`. We wont everything be visible
-at the `https://some-server/tensorhive`. Example proxy definition is as follows:
+<details>
+<summary>(see example)</summary>
+<p>
+
+Let's assume that the WebApp is served locally on `http://localhost:5000`, the API on `http://localhost:1111` and we
+want to serve TensorHive publicly at `https://some-server/tensorhive`. In such case the following `main_config.ini`:
+
+```
+url_schema = https
+url_hostname = some-server
+url_port = 443
+url_prefix = tensorhive/api
+```
+should be used along with a reverse proxy similar to the following example for nginx:
```
location /tensorhive {
@@ -205,11 +227,10 @@ location /tensorhive/api {
proxy_pass http://localhost:1111;
}
-
```
-For the frontend to work correctly you also need to change the file `tensorhive/app/web/dev/src/main.js` and set
-the `base:` attribute of the router to the same URL context as in the proxy.
+</p>
+</details>
Contribution and feedback
------------------------
