繁体   English   中英

使用运行来自 dockerhub (nginx:alpine) 的最新版本 nginx 的 Docker 容器时出现 Nginx 配置错误

[英]Nginx config error when using a Docker Container running the latest version of nginx from dockerhub (nginx:alpine)

我有一个 nginx 错误,我想知道为什么会发生这种情况,在 debian 10 服务器上,此配置运行良好,但在我的 alpine nginx docker 容器上却出现此错误

/etc/nginx # nginx -t
2020/01/17 18:13:06 [emerg] 189#189: unexpected "s" in /etc/nginx/sites-enabled/phpMyAdmin.conf:33
nginx: [emerg] unexpected "s" in /etc/nginx/sites-enabled/phpMyAdmin.conf:33
nginx: configuration file /etc/nginx/nginx.conf test failed

这是配置文件https://pastebin.com/CwELESRB这是出现错误的行

add_header Content-Security-Policy "frame-ancestors 'self'";

非常感谢任何帮助:D

我在您的指令中看到的唯一问题是分号的位置,它应该在引号内。

add_header Content-Security-Policy "frame-ancestors 'self';"

本页底部有一些示例。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM