我正在尝试在生产模式下配置最新版本的 Mercure。
我正在运行这个版本 mercure_0.10.3_Linux_x86_64
运行命令
PUBLISHER_JWT_KEY=XXXXXX \
SUBSCRIBER_JWT_KEY=XXXXXX \
CORS_ALLOWED_ORIGINS=* \
ADDR=':3000' \
CERT_FILE=/etc/nginx/ssl/nginx.crt \
KEY_FILE=/etc/nginx/ssl/nginx.key \
DEBUG=1 \
ALLOW_ANONYMOUS=1 \
./mercure
INFO[0000] Mercure started addr=":3000" protocol=https
Nginx 反向代理配置
server {
#listen 80 http2;
listen 80 ;
#listen 443 ssl http2;
listen 443 ssl ;
ssl on;
server_name my-domain.com;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
proxy_pass https://127.0.0.1:3000;
proxy_read_timeout 24h;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
当我尝试从 (https) 发布时https://my-domain.com/.well-known/mercure
,我收到了这个错误的错误
Peer certificate cannot be authenticated with given CA certificates for "https://my-domain.com/.well-known/mercure
当我尝试从 (http) 发布时http://my-domain.com/.well-known/mercure
,没有问题
INFO[0022] Update published event_id="urn:uuid:6f2ee286-ad54-48c6-b803-c8d7d9d9624c" event_retry=0 event_type= remote_addr="127.0.0.1:50444" update_data="XXXXX" update_private=false update_topics="[/notification/3702778]"
127.0.0.1 - - [11/Sep/2020:16:35:16 +0200] "POST /.well-known/mercure HTTP/1.1" 200 45 "" "Symfony HttpClient/Curl"
我的配置有问题吗?