Nginx¶
Note that this configuration described here will make the server publicly available in the network.
See nginx documentation for more details.
Note
This nginx configration works with uWSGI. Make sure that you have the neccessary uWSGI service running for the backend.
Installation¶
Configuration¶
Configuration for sites have to be placed inside /etc/nginx/sites-available
Serving Backend¶
Below is a simple working configuration. Note that this is not suited for global use.
Note
This configuration will make the server publicly available in the current network over the IP of the device where it is installed (HTTP only). To make it public it’s recommended to add certificates for HTTPS. However the easiest way to do this is to use Traefik Installation Guide.
/etc/nginx/sites-available/muscle_backend
:
The value of PATH_TO_SOCKET is configured in the backend’s muscle.ini
and defaults to /tmp/muscle.sock
Serving Frontend¶
If you want to serve the webapp with the same server as the backend add these lines inside the server{ }
directive of /etc/nginx/sites-available/muscle_backend
above location /api/ {...}
. Otherwise configure a new server as described in the backend section above.
Replace <PATH_TO_DIST_FOLDER>
with the path to the dist folder of the built frontend.
Activation¶
To activate the configuration run the following commands: