8/24/2016

How to install nginx to serve static files

1. sudo apt install nginx
2. Create a new directory /var/www/track_data
3. Create a new site configuration under /etc/nginx/sites-available
4. Change the nginx settings(/etc/nginx/sites-available/static_content):
server {
  listen 80;

  root /var/www/track_data;

  location / {
      add_header 'Access-Control-Allow-Origin' '*';
      add_header 'Access-Control-Allow-Methods' 'GET';
      autoindex on;
  }
}




No comments: