# Final Tests

## 8. Final tests

1. ****Test HTTPS through Nginx:****  
    In a browser or terminal, go to:  
    ```
    https://abeta-proxy.finmars.com/demo/md/3.0/accounts
    ```
    
    
    - <span style="white-space: pre-wrap;">Enter Basic Auth user </span>`<span class="editor-theme-code">foo</span>`<span style="white-space: pre-wrap;"> and password </span>`<span class="editor-theme-code">bar</span>`.
    - If your Base64 tokens are correct, you see JSON from Exante.
2. ****Test other routes:****  
    ```
    https://abeta-proxy.finmars.com/live/md/3.0/accounts
    ```
    
    
    - Use the same Basic Auth.
    - Should return JSON if live token is correct.
3. ****Test local APISIX again (no Nginx):****  
    ```
    curl -u foo:bar http://127.0.0.1:9080/demo/md/3.0/accounts
    ```
    
    
    - This hits APISIX directly, without Nginx.
    - Should return JSON if config is correct.

---

## 9. Automatic certificate renewal

1. Certbot already set up automatic renewal.
2. To test renewal, run:  
    ```bash
    sudo certbot renew --dry-run
    ```
3. If it says “Congratulations, all renewals succeeded,” your auto-renew is working.

---

## 10. How to update your APISIX config later

1. <span style="white-space: pre-wrap;">Edit </span>`<span class="editor-theme-code">/opt/apisix/apisix.yaml</span>`<span style="white-space: pre-wrap;"> any time:</span>  
    ```bash
    sudo nano /opt/apisix/apisix.yaml
    ```
2. Save changes and exit.
3. Run the restart script:  
    ```bash
    ./restart_apisix.sh
    ```
4. Check logs:  
    ```bash
    sudo docker logs apache-apisix
    ```
5. <span style="white-space: pre-wrap;">Test again with </span>`<span class="editor-theme-code">curl</span>`<span style="white-space: pre-wrap;"> or in a browser.</span>

---