   server {

    listen 9001;

    include /etc/nginx/includes/server_params.conf;
    include /etc/nginx/includes/proxy_params.conf;

    ssl_certificate /ssl/%%certfile%%;
    ssl_certificate_key /ssl/%%keyfile%%;

    location / {
      # Proxy pass
      proxy_pass http://localhost:9000;

      # Next three lines allow websockets
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";

      # Improve ip handling
      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_set_header Accept-Encoding "";
      proxy_read_timeout 90;
      }

}
