I changed my /etc/nginx/sites-enabled/00-default-ssl.conf following this instructions, and using the “Subfolder unified” config.
→ part of /etc/nginx/sites-enabled/00-default-ssl.conf
location /strapi/ {
rewrite ^/strapi/?(.*)$ /$1 break;
proxy_pass http://strapi;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $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_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass_request_headers on;
}
I realized that I was trying to reach my API endpoint using botike.com.br/strapi/botike-home and get the 404 error message. Now I’m using botike.com.br/strapi/api/botike-home and now the error is 403:
{
"data": null,
"error": {
"status": 403,
"name": "ForbiddenError",
"message": "Forbidden",
"details": {}
}
}
I know that I’m making mistakes and asking silly questions, but I’m really lost on this matter…