script-install-reverse-proxy 610 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env bash
  2. # Adds a reverse proxy for local system services
  3. # Copyright 2021 Bryan C. Roessler
  4. parent="${BASH_SOURCE[0]}"
  5. parent=${parent%/*}
  6. [[ -f $parent/script-functions ]] && . "$parent"/script-functions || exit 1
  7. is_root
  8. dnf install -y nginx || exit $?
  9. cat <<- 'EOF' > /etc/nginx/conf.d/hartmanlab.conf
  10. server {
  11. listen 80 default_server;
  12. server_name localhost;
  13. location /cockpit {
  14. proxy_pass http://localhost:9090;
  15. }
  16. }
  17. EOF
  18. # location /robot {
  19. # proxy_pass http://127.0.0.1:8888;
  20. # proxy_redirect http://127.0.0.1:8888/;
  21. # }
  22. systemctl enable --now nginx
  23. exit $?