Nginx

See nginx documentation for more details about this server.

Note

Make sure the needed uWSGI service is working before configuring the server.

Installation

sudo apt install nginx

Configuration

Create a new configuration file/etc/nginx/sites-available/muscle_device with the following contents:

server {
  listen 80;
  server_name 0.0.0.0;

  location / {
    include uwsgi_params;
    uwsgi_pass unix:<PATH_TO_SOCKET>;
  }
}

The value of <PATH_TO_SOCKET> is configured in the devices muscle_device.ini and defaults to /tmp/muscle_device.sock. Replace it with the correct path.

The port and server name can be adjusted to your needs.

Enable the Configuration

To use the device API enable the newly configured site by creating a link and restarting the server:

sudo ln -s /etc/nginx/sites-available/muscle_device /etc/nginx/sites-enabled
sudo rm /etc/nginx/sites-enabled/default
sudo systemctl restart nginx