chore(websocket): 已经初步实现服务器端按照流式请求反馈信息的功能
This commit is contained in:
@@ -12,10 +12,8 @@ COPY ./sites-enabled/ /etc/nginx/sites-enabled/
|
||||
# 暴露端口
|
||||
EXPOSE 80 443
|
||||
|
||||
# 添加在Dockerfile末尾,CMD命令之前
|
||||
COPY ./entrypoint.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
# 直接在Dockerfile中执行权限设置,不使用entrypoint.sh
|
||||
RUN mkdir -p /var/log/nginx && chmod -R 0444 /etc/nginx/conf.c && chmod 0444 /etc/nginx/conf.d/default.conf && chmod -R 0755 /etc/nginx/sites-enabled
|
||||
|
||||
# 启动nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -8,6 +8,13 @@
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# 禁用缓冲,确保WebSocket数据实时传输
|
||||
proxy_buffering off;
|
||||
proxy_buffer_size 4k;
|
||||
proxy_buffers 4 4k;
|
||||
proxy_busy_buffers_size 4k;
|
||||
proxy_max_temp_file_size 0;
|
||||
|
||||
# 可选:设置超时(WebSocket 是长连接)
|
||||
proxy_read_timeout 86400s;
|
||||
proxy_send_timeout 86400s;
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
# add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
# --- SSL configuration end ---
|
||||
|
||||
# 启用 WebSocket 支持
|
||||
include conf.c/enable-websocket.conf;
|
||||
|
||||
#PHP-INFO-START PHP引用配置,可以注释或修改
|
||||
include conf.c/enable-php-74.conf;
|
||||
#PHP-INFO-END
|
||||
|
||||
# 启用 WebSocket 支持
|
||||
include conf.c/enable-websocket.conf;
|
||||
|
||||
# --- REWRITE-START --- URL重写规则引用,修改后将导致面板设置的伪静态规则失效
|
||||
# include /www/server/panel/vhost/rewrite/xcx30.5g-quickapp.com.conf; # 等于下面的内容
|
||||
location / {
|
||||
|
||||
Reference in New Issue
Block a user