Skip to content

禁用公共 REST API(Disable the public REST API)#

n8n 公共 REST API 允许你以编程方式执行许多与 n8n GUI 中相同的任务。

🌐 The n8n public REST API allows you to programmatically perform many of the same tasks as you can in the n8n GUI.

如果你不打算使用此 API,n8n 建议你禁用它以提高 n8n 安装的安全性。

🌐 If you don't plan on using this API, n8n recommends disabling it to improve the security of your n8n installation.

要禁用公共 REST API,请将 N8N_PUBLIC_API_DISABLED 环境变量设置为 true,例如:

🌐 To disable the public REST API, set the N8N_PUBLIC_API_DISABLED environment variable to true, for example:

1
export N8N_PUBLIC_API_DISABLED=true

禁用 API Playground(Disable the API playground)#

要禁用 API playground,请将 N8N_PUBLIC_API_SWAGGERUI_DISABLED 环境变量设置为 true,例如:

🌐 To disable the API playground, set the N8N_PUBLIC_API_SWAGGERUI_DISABLED environment variable to true, for example:

1
export N8N_PUBLIC_API_SWAGGERUI_DISABLED=true

有关这些环境变量的更多信息,请参阅部署环境变量

🌐 Refer to Deployment environment variables for more information on these environment variables.

有关设置环境变量的更多信息,请参阅配置

🌐 Refer to Configuration for more information on setting environment variables.