NodeBB 在 Nginx 反向代理上非常慢
NodeBB horribly slow over Nginx reverse proxy
我是 运行 Nginx 反向代理背后的 NodeBB,我偶尔会遇到超过 10 秒的加载时间,否则平均加载时间为 2 秒(仍然太多)。还应该注意的是,当我在端口 NodeBB 上访问论坛时,加载时间总共约为 200 毫秒 运行,但我不需要这样做。
我一辈子都弄不明白为什么这个反向代理这么慢。
如果您想了解哪些部分加载缓慢,请随时检查 the NodeBB install 上的网络流量。
欢迎并赞赏所有建议!
这是我的 Nginx 服务器:
server {
listen 80;
server_name forums.hydroxium.com;
location / {
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_redirect off;
proxy_pass http://127.0.0.1:4567;
}
这是我的 Nginx 配置:
user www-data;
worker_processes 4;
worker_rlimit_nofile 20480;
pid /run/nginx.pid;
events {
worker_connections 5120;
multi_accept on;
use epoll;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
charset utf-8;
client_body_timeout 65;
client_header_timeout 65;
client_max_body_size 10m;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
}
原来 VPS 是 运行 开启的问题,它根本没有足够的能力同时 运行 所有东西而不是缓慢。
我是 运行 Nginx 反向代理背后的 NodeBB,我偶尔会遇到超过 10 秒的加载时间,否则平均加载时间为 2 秒(仍然太多)。还应该注意的是,当我在端口 NodeBB 上访问论坛时,加载时间总共约为 200 毫秒 运行,但我不需要这样做。
我一辈子都弄不明白为什么这个反向代理这么慢。
如果您想了解哪些部分加载缓慢,请随时检查 the NodeBB install 上的网络流量。
欢迎并赞赏所有建议!
这是我的 Nginx 服务器:
server {
listen 80;
server_name forums.hydroxium.com;
location / {
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_redirect off;
proxy_pass http://127.0.0.1:4567;
}
这是我的 Nginx 配置:
user www-data;
worker_processes 4;
worker_rlimit_nofile 20480;
pid /run/nginx.pid;
events {
worker_connections 5120;
multi_accept on;
use epoll;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
charset utf-8;
client_body_timeout 65;
client_header_timeout 65;
client_max_body_size 10m;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
}
原来 VPS 是 运行 开启的问题,它根本没有足够的能力同时 运行 所有东西而不是缓慢。