Complete Recap
Complete Recap
- Create folder
/opt/apisix
. - Create and fill
/opt/apisix/apisix.yaml
(withrole: data_plane
, consumers, upstreams, plugin_configs, routes, and#END
). - Make
restart_apisix.sh
script that stops any old container and starts a new one, mounting/opt/apisix/apisix.yaml
as bothconfig.yaml
andapisix.yaml
. - Run
./restart_apisix.sh
to start APISIX. - Test APISIX locally:
curl -u foo:bar http://127.0.0.1:9080/demo/md/3.0/accounts
. - Install Nginx (
sudo apt install nginx
). - Install Certbot (
sudo apt install certbot python3-certbot-nginx
). - Get SSL:
sudo certbot --nginx -d abeta-proxy.finmars.com
. - Edit Nginx site at
/etc/nginx/sites-available/default
to add:location / { proxy_pass http://127.0.0.1:9080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; }
- Reload Nginx (
sudo nginx -t
thensudo systemctl reload nginx
). - Open firewall ports 80, 443, 9080 (
sudo ufw allow ...
). - Test
https://abeta-proxy.finmars.com/demo/md/3.0/accounts
in a browser. - Auto-renew is handled by Certbot.
- To update, edit
/opt/apisix/apisix.yaml
and run./restart_apisix.sh
.
That is the full, clear set of instructions. Now your APISIX runs behind Nginx with a Let’s Encrypt SSL certificate, and you can update the config anytime by editing the file and restarting with the script.