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.shscript that stops any old container and starts a new one, mounting/opt/apisix/apisix.yamlas bothconfig.yamlandapisix.yaml. - Run
./restart_apisix.shto 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/defaultto 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 -tthensudo systemctl reload nginx). - Open firewall ports 80, 443, 9080 (
sudo ufw allow ...). - Test
https://abeta-proxy.finmars.com/demo/md/3.0/accountsin a browser. - Auto-renew is handled by Certbot.
- To update, edit
/opt/apisix/apisix.yamland 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.