【问题标题】:Nginx config for docker php-fpm container: "Access to the script '/xxx/xxx/openapi/index.html' has been denied (see security.limit_extensions)"docker php-fpm 容器的 Nginx 配置:“访问脚本 '/xxx/xxx/openapi/index.html' 已被拒绝(请参阅 security.limit_extensions)”
【发布时间】:2020-02-22 01:01:59
【问题描述】:

在我需要访问的 php-fpm 容器中生成了 swagger openapi。 这是来自 nginx default.conf 的相应位置块:

location /openapi/ {
    alias /xxx/xxx/openapi/;
    fastcgi_pass php-fpm:9000;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    fastcgi_param PATH_TRANSLATED $request_filename;
    include fastcgi_params;
}

来自 php-fpm 容器的 docker 日志:

"GET /openapi/index.html" 403
NOTICE: Access to the script '/xxx/xxx/openapi/index.html' has been denied (see security.limit_extensions)

有什么建议吗?

【问题讨论】:

    标签: php docker nginx


    【解决方案1】:

    无视。我刚刚在 Dockerfile 中为 php-fpm 共享了 openapi 位置:

    VOLUME ["/xxx/xxx"]
    

    然后用nginx挂载到容器中直接服务。

    【讨论】:

      猜你喜欢
      • 2015-10-04
      • 2016-12-30
      • 2014-04-15
      • 1970-01-01
      • 2015-01-13
      • 2014-06-16
      • 1970-01-01
      • 1970-01-01
      • 2016-03-26
      相关资源
      最近更新 更多