DEV Auth API¶
1. Overview¶
The DEV Auth API provides authentication services for the Surefy DEV environment.
| Setting | Value |
|---|---|
| Environment | Development |
| API Domain | https://devauthapi.surefy.ai |
| EC2 Public IP | 15.252.206.8 |
| Docker Container | authapi |
| Host Port | 5003 |
| Container Port | 5000 |
| Protocol | HTTPS |
2. API Access¶
Base URL
https://devauthapi.surefy.ai
Login URL
https://devauthapi.surefy.ai/login
Verify the actual API route and HTTP method against the application configuration before using the login URL.
3. Architecture¶
Client
|
| HTTPS (443)
v
devauthapi.surefy.ai
|
v
Nginx Reverse Proxy
|
| HTTP (127.0.0.1:5003)
v
Docker Container: authapi
|
| Port 5000
v
DEV Auth API
4. Nginx Configuration¶
Configuration file:
/etc/nginx/sites-available/devauthapi.surefy.ai
Proxy target:
proxy_pass http://127.0.0.1:5003;
Useful commands:
sudo nginx -t
sudo systemctl reload nginx
sudo systemctl status nginx
5. SSL Certificate¶
The domain uses Let's Encrypt SSL managed by Certbot.
| Setting | Value |
|---|---|
| Domain | devauthapi.surefy.ai |
| Certificate | /etc/letsencrypt/live/devauthapi.surefy.ai/fullchain.pem |
| Private Key | /etc/letsencrypt/live/devauthapi.surefy.ai/privkey.pem |
| Expiry | 27 February 2027 |
| Renewal | Certbot automatic renewal configured |
Verify SSL:
echo | openssl s_client \
-connect devauthapi.surefy.ai:443 \
-servername devauthapi.surefy.ai 2>/dev/null \
| openssl x509 -noout -subject -dates -ext subjectAltName
6. Docker Operations¶
Check the container:
sudo docker ps --filter name=authapi
View logs:
sudo docker logs --tail 100 authapi
Test the backend:
curl -i http://127.0.0.1:5003/
7. HTTPS Verification¶
curl -i https://devauthapi.surefy.ai/
A 404 at / may be expected if the application does not define a root route.
8. Troubleshooting¶
| Issue | Action |
|---|---|
| Domain unavailable | Check DNS resolution |
| SSL error | Verify certificate and Certbot |
| 502 Bad Gateway | Check authapi container and port 5003 |
| API unavailable | Check Docker logs |
| Nginx failure | Run sudo nginx -t |
| Authentication failure | Check application authentication configuration |
9. Security¶
- Never store passwords, API keys, tokens or database credentials in documentation.
- Restrict EC2 and API access to authorized users.
- Keep SSL certificates renewed.
- Review application logs during authentication failures.
10. Environment Notes¶
This documentation describes the DEV Auth API environment. Update it whenever the API domain, Docker configuration, Nginx settings or SSL configuration changes.