我正在尝试在AWS上设置Strapi,并且AM一直在关注Strapi文档在这里。但是,当我开始启动EC2实例时,我遇到了一些文档中未解决的错误。应用程序密钥,JWT Secrets和其他Env Config变量。还有其他人尝试过并遇到类似问题吗?你是怎么解决事情的?我在EC2实例中一直在运行 pm2 log
以获取错误。
我会发布我的配置,但所有内容都遵循Strapi Docs到字母上,并且现在已经贯穿了几个步骤,并且我不想再次将文档复制并粘贴到这里。我的最后一步是让Strapi在EC2实例上运行,但是我一直遇到这样的错误,
error: Missing jwtSecret. Please, set configuration variable "jwtSecret" for the users-permissions plugin in config/plugins.js (ex: you can generate one using Node with `crypto.randomBytes(16).toString('base64')`).
这些错误似乎在任何地方都无法解决。
I am trying to setup Strapi on AWS and am have been following the Strapi documentation here. But when I get to starting the EC2 instance, I have run into a few errors that were not addressed in in the docs. App keys, jwt secrets, and other env config variables. Has anyone else tried this and run into similar issues? And how did you get around things? I have been running pm2 log
in my EC2 instance to get the errors.
I would post my config and everything but I have followed the strapi docs to the letter, and have run through every single step a dozen times now, and I don't want to basically copy and paste the docs in here again. My last step is to get Strapi to run on the EC2 instance, but I keep running into errors like this
error: Missing jwtSecret. Please, set configuration variable "jwtSecret" for the users-permissions plugin in config/plugins.js (ex: you can generate one using Node with `crypto.randomBytes(16).toString('base64')`).
which don't seem to be addressed in the docs anywhere.
发布评论
评论(2)
这是因为您需要公开
jwt_secret
(和admin_jwt_secret
)环境变量。您可以通过添加(您可以添加这样的行:jwt_secret = a_random_string_here
)来执行此操作(jwt_secret = a_random_string_here
)。您可以在此处找到更多详细信息:
This is because you need to expose the
JWT_SECRET
(andADMIN_JWT_SECRET
) environment variable. You can do it by adding (you can add a line like this:JWT_SECRET=A_RANDOM_STRING_HERE
) it to the.env
file located at the root of your Strapi project.You can find more details here: https://docs.strapi.io/developer-docs/latest/plugins/users-permissions.html#jwt-configuration
您可以生成JWT
You can generate jwt