2
我在Nginx反向代理後面運行NodeBB,並且偶爾會遇到超過10秒的加載時間,否則平均2秒加載時間(仍然太多)。還應該注意,當我訪問NodeBB上的端口上的論壇時,加載時間總共大約爲200毫秒,但我不需要這樣做。NodeBB可怕的緩慢的Nginx反向代理
我不能爲了我的生活找出爲什麼這個反向代理是如此緩慢。
如果您想弄清哪些部件的加載速度很慢,請隨時檢查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;
}