System Information
- Strapi Version: 4.4.5
- Operating System: Ubuntu 20.04
- Database: Postgres
- Node Version: 16.18
- NPM Version: 8.19.2
- Yarn Version:
Hi Strapi fellows!
I installed Strapi and since I’m already using /api adress, I manage to write these files to change it to “strapi”:
→ …config/server.js
module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
url: 'https://botike.com.br/strapi/',
app: {
keys: env.array('APP_KEYS'),
},
});
→ /etc/nginx/sites-enabled/00-default-ssl.conf
# Strapi API
location /strapi/ {
rewrite ^/strapi/(.*)$ /$1 break;
proxy_pass http://strapi;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
}
# Strapi Dashboard
location /strapi/admin/ {
proxy_pass http://strapi/admin;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
}
With this, I can expose the main page and the admin panel without no errors. But I couldn’t get no info from my-domain/strapi/endpoint:
{
"data": null,
"error": {
"status": 404,
"name": "NotFoundError",
"message": "Not Found",
"details": {}
}
}
And I noted something: when I was trying to fix it generating a API Token, I noted that my choice of using “strapi” instead “api” didn’t get reflect on it:
I tryed to move back to “/api” and it didn’t worked either…
Any advice for this noob question will be highly appreciated