Nginx Configuration

To configure nginx:

  1. If necessary, switch user to root.

    $ sudo su
  2. Open /etc/nginx/sites-available/default for editing, and replace the entire contents of the file with the following:

    server {
      listen 81 default;
      include /etc/nginx/default-site/*.conf;
    }
  3. Create a new folder to contain your site definitions:

    # mkdir /etc/nginx/default-site/
  4. Add three files to the new /etc/nginx/default-site/ folder, called cue-web.conf and webservice.conf:

    # touch /etc/nginx/default-site/cue-web.conf
    # touch /etc/nginx/default-site/webservice.conf
    # touch /etc/nginx/conf.d/request-entity-size-limit.conf
  5. Open /etc/nginx/default-site/cue-web.conf for editing and add the following contents:

    location /cue-web/ {
            alias /var/www/html/cue-web/;
            expires modified +310s;
    }

    Depending on the version of nginx that you have installed, the alias specified in cue-web.conf may need to be set to /var/www/cue-web/ instead of /var/www/html/cue-web/.

  6. Open /etc/nginx/default-site/webservice.conf for editing and add the contents described in Web Service CORS Configuration.

  7. Open /etc/nginx/conf.d/request-entity-size-limit.conf for editing and add the following contents:

    # Disable default 1Mb limit of PUT and POST requests.
    client_max_body_size 0;

    (If you do not add this setting, then nginx will not allow larger files such as images and videos to be uploaded to CUE.)

You will now need to set up cross-origin communication between CUE and the Content Store web service as described in Web Service CORS Configuration.