我制作了一个 php 事件流脚本,当 nginx 没有启用 tls (ssl) 但在启用 tls 后,对事件流的请求保持挂起时,它工作得非常好。我尝试禁用 ssl 缓存、代理缓存([这里][1] 是我的网站配置文件),但我对 nginx 还是很陌生。我还在我的 php 脚本中设置了标题“X-Accel-Buffering: no”,但没有结果。另外,这是我的 ngninx conf文件。我的配置中缺少一行吗?
谢谢。[1]:https ://pastebin.com/a2NutTUA
server {
listen 8943 default_server ssl;
listen [::]:8943 default_server ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/REDACTED-0001/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/REDACTED-0001/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_buffer_size 0;
root /var/www/nginxlive;
index index.html index.htm index.nginx-debian.html index.php;
server_name localhost;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_buffer_size 0;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
}
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
multi_accept on;
}
http {
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip off;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}