问题原文
原帖链接 · bato3 · CC BY-SA 4.0
I'm updated nginx to 1.23.4, and nginx -t start showing warnings:
nginx: [warn] protocol options redefined for 0.0.0.0:443 in /etc/nginx/sites-enabled/beta:5
nginx: [warn] protocol options redefined for [::]:443 in /etc/nginx/sites-enabled/default:28
nginx: [warn] protocol options redefined for [::]:443 in /etc/nginx/sites-enabled/grafana:5
These lines are
listen 443 ssl;
listen [::]:443 ssl;
# sometimes:
# listen 443 ssl;
# listen [::]:443;
# I'm now know - some inconsistency, fixed
But after tweaking and adding http2 there were more warnings.
社区高分解答
原帖链接 · bato3 · CC BY-SA 4.0
It turned out that I didn't correct the configuration enough. Corrections must be made on all servers configurations.
To find all the wrong occurrences, you can help yourself:
grep -R /etc/nginx/ -e 443 |grep -v ssl
grep -R /etc/nginx/ -e 443 |grep -v http2
Important: All servers listening on the same port should have identical configuration.
eg.:
listen 443 ssl http2;
#bad: ssl without http2
listen 443 ssl;
#ok: identical protocols as in previous (first) server
listen 443 ssl http2;
More details are in commit: https://github.com/nginx/nginx/commit/dad65f3e449f215469943628f2b1f12a118fcf7e
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
