helper script
#!/usr/bin/env bash
# Transfers a file from local to remote
PATH_TO_FILE=$1
IP=$2
USERNAME=$3
PATH_TO_SSH_KEY=$4
if [ $# -lt 3 ]; then
echo 'Usage: 0-transfer_file PATH_TO_FILE IP USERNAME PATH_TO_SSH_KEY'
elif [ "$#" -eq 3 ]
then
scp -o StrictHostKeyChecking=no $PATH_TO_FILE "$USERNAME@$IP:~/"
else
scp -o StrictHostKeyChecking=no -i $PATH_TO_SSH_KEY $PATH_TO_FILE "$USERNAME@$IP:~/"
fi
example usage
./0-transfer_file pocketbase 18.206.13.229 ubuntu ~/.ssh/id_rsa
/etc/nginx/conf.d
eg pb.conf
server {
listen 80;
server_name pb.tigawanna.tech;
location / {
# check http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
proxy_set_header Connection '';
proxy_http_version 1.1;
proxy_read_timeout 360s;
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_pass http://127.0.0.1:8090;
}
}
sudo nginx -t
sudo nginx -s reload
optionannly add a pb_public with a html file inside it which will be displayed when you hit your provided URL in this case : pb.tigawanna.tech
pb.tigawanna.tech/_/ : fr admin panel and pb.tigawanna.tech/api : for rest pai access