Commit 8ec897f06715fab02249a88387b6499a013a9dee
1 parent
6d96ed98
Exists in
master
and in
2 other branches
Adding Apache configuration file that sets a reverse proxy between the webserver…
… and Noosfero API, so the mobile app and the backend can communicate on a safe way
Showing
1 changed file
with
18 additions
and
0 deletions
Show diff stats
README.md
| ... | ... | @@ -16,3 +16,21 @@ This application is built on top of Ionic, so you need this framework. |
| 16 | 16 | In order to compile the theme, you need to run: `gulp sass` |
| 17 | 17 | |
| 18 | 18 | You need to configure the application by creating a file `www/js/config.js` based on `www/js/config.js.example`. |
| 19 | + | |
| 20 | +## Connecting to Noosfero | |
| 21 | + | |
| 22 | +One way to connect with Noosfero API is to set the `Access-Control-Allow-Origin` header on the Noosfero side and thus allow connections. | |
| 23 | + | |
| 24 | +Another way is to set a reverse proxy on a webserver in front of Noosfero. For example, let's assume there is | |
| 25 | +a host called `confjuv`. If you have the following Apache configuration for this site, you can access the front-end | |
| 26 | +by going to http://confjuv/www and any other request path will be forwarded to Noosfero running on `localhost:3000`: | |
| 27 | + | |
| 28 | +```apache | |
| 29 | +<VirtualHost *:80> | |
| 30 | + ServerName confjuv | |
| 31 | + DocumentRoot /var/www/confjuvapp # This is the ConfJuvApp directory inside this repository | |
| 32 | + ProxyPass /www ! | |
| 33 | + ProxyPass / http://localhost:3000/ | |
| 34 | + ProxyPassReverse / http://localhost:3000/ | |
| 35 | +</VirtualHost> | |
| 36 | +``` | ... | ... |