Using nginx to serve static page in dev mode - solidcrafters/Rio GitHub Wiki

Config file


On ubuntu

As root :

  • Create a file called rio in /etc/nginx/sites-available with this content.

      server {
          listen PORT;
          location / {
              root YOUR_PATH_TO_DIST;
          }
      }
    

    Where PORT is the port you want nginx to listen at and YOUR_PATH_TO_DIST the path you want to be served by nginx (your dist directory). Of course www-data must have read access to that directory.

  • Create a symbolic link to that file in /etc/nginx/sites-enabled

      cd  /etc/nginx/sites-enabled
      ln -s /etc/nginx/sites-available/rio .
    

On mac

Start nginx

On ubuntu

As root :

service nginx start

On mac