Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx installation is missing #103

Open
Hellseher opened this issue Jan 13, 2021 · 1 comment
Open

Nginx installation is missing #103

Hellseher opened this issue Jan 13, 2021 · 1 comment

Comments

@Hellseher
Copy link

Hellseher commented Jan 13, 2021

Hi,

Thank you for sharing your deployment plan.

I tried to find how to put client LB behind Security group to limit access to specific IPs and did not find on which point Nginx is installed and how it was provisioned.

@Bamieh
Copy link
Contributor

Bamieh commented Jun 23, 2021

You'll end up needing nginx anyways if you want to have the public endpoint of Kibana served behind a different port.

  1. I added this to the file to the assets under assets/scripts/nginx/config-clients.sh
#!/bin/bash
set +e

sudo mkdir -p /var/log/nginx/

sudo rm /etc/nginx/sites-enabled/default
sudo touch /etc/nginx/sites-enabled/default

sudo bash -c 'cat <<EOF >>/etc/nginx/sites-enabled/default
server {
  listen       80;

  access_log /var/log/nginx/reverse-access.log;
  error_log /var/log/nginx/reverse-error.log;

  location / {
    proxy_pass http://$(hostname -i):5601;
  }
}
EOF'

# Make sure config file is valid
sudo nginx -t
# Start nginx
systemctl enable nginx.service
sudo systemctl restart nginx
  1. Added this file to packer install-nginx.sh
# Fix for the apt lock issue
sleep 100

echo "Installing Nginx"

sudo apt-get update
sudo -E apt-get install -y nginx
  1. Added this provisition at the end of the kibana packer file
      ...
   },
   {
      "type": "shell",
      "script": "install-nginx.sh",
      "execute_command": "echo '' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'"
   }
]
  1. and finally added this to the end of the client script in assets/scripts/client.sh
/opt/cloud-deploy-scripts/nginx/config-clients.sh

Hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants