Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Login to the Nginx server.  If you are using the project key pair it will look like this (make sure you have the key in your .ssh folder, get it from Nebula interface https://nebula.ncsa.illinois.edu/dashboard/project/access_and_security/:

    Code Block
    ssh -i ~/.ssh/<key> ubuntu@<vm floating ip address>


  2. Install Nginx:

    Code Block
    apt-get install nginx


  3. Edit nginx config 

    Code Block
    sudo vim /etc/nginx/sites-available/gltg 	# creates file name gltg and opens vim editor


  4. populate config (this is bare min without ssl, more docs coming)

    Code Block
    server {
      listen 80;
      client_max_body_size 0;
    
      proxy_read_timeout 300;  # answer from server, 5 min
      proxy_send_timeout 300;  # chunks to server, 5 min
    
      proxy_set_header   Host $host;
      proxy_set_header   X-Real-IP $remote_addr;
      proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header   X-Forwarded-Proto $scheme;
      proxy_http_version 1.1;
      port_in_redirect   off;
    
      root /usr/share/nginx/html;
      index index.html index.htm;
    
      # Deny all attempts to access hidden files
      # such as .htaccess, .htpasswd, .DS_Store (Mac).
      location ~ /\. {
        deny all;
      }
    
      location / {
          try_files $uri $uri/ /index.html;
      }
    
      rewrite ^/geodashboard$ /geodashboard/ permanent;
      location /geodashboard {
        proxy_pass http://<geodashboard floating IP>:9000;				# replace <geodashboard floating IP> with the floating IP of your geodashboard machine
      }
    
      rewrite ^/clowder$ /clowder/ permanent;
      location /clowder/ {
        proxy_pass http://<clowder floating IP>:9000;					# replace <clowder floating IP> with the floating IP of your geodashboard machine
      }
    }