nginx web服务器很慢,经常是404

所以我在装载页面时安装了“lemp”(Nginx,MySQL,PHP)和Wordpress 需要10秒也经常发生Web服务器向我显示消息“404 Not Found”,然后在5分钟后返回。</ p>

这可能会有所帮助:</ p>
\ n

  user www-data; 
worker_processes 4;
pid /var/run/nginx.pid;

events {
worker_connections 768;
multi_accept on;
使用epoll;
}

http {

##
#基本设置
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
client_max_body_size 100m;

#server_names_hash_bucket_size 64;
#server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application / octet-stream;

##

#记录设置
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
nn##
#Gzip设置
##

gzip on;
gzip_disable“msie6”;

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1; \ n gzip_types text / plain text / css application / json application / x-javascript text / xml application / xml application / xml + rss text / javascript;

##
#nginx-naxsi config
##
#如果安装了nginx-naxsi,则取消注释
##

#include /etc/nginx/naxsi_core.rules;
nn ##
#nginx-passenger config
##
#取消注释 如果您安装了nginx-passenger
##

#passenger_root / usr;
#passenger_ruby / usr / bin / ruby​​;

##
#虚拟主机配置
##

include /etc/nginx/conf.d/*.conf;
include / etc / nginx / sites-enabled / *;
}

#mail {
##请参阅示例验证脚本:

## http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript

## auth_http localhost / auth.php;
## pop3_capabilities“TOP”“USER”;
##imap_capabi lities“IMAP4rev1”“UIDPLUS”;

#server {
#listen localhost:110;
#protocol pop3;
#s proxy on;
#}

#server {
#shop localhost:143;
#protocol imap;
#proxy on;
#}
#}
</ code> </ pre>
</ div>

展开原文

原文

So I installed "lemp" (Nginx, MySQL, PHP) and Wordpress on it how ever when loading a page it needs 10 seconds also it often happens that the web server shows me the message "404 Not Found" and then comes back after 5 minutes.

This may help:

user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
    worker_connections 768;
    multi_accept on;
        use epoll;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    server_tokens off;
        client_max_body_size  100m;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    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;

    ##
    # nginx-naxsi config
    ##
    # Uncomment it if you installed nginx-naxsi
    ##

    #include /etc/nginx/naxsi_core.rules;

    ##
    # nginx-passenger config
    ##
    # Uncomment it if you installed nginx-passenger
    ##

    #passenger_root /usr;
    #passenger_ruby /usr/bin/ruby;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}


#mail {
#   # See sample authentication script at:
#   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#   # auth_http localhost/auth.php;
#   # pop3_capabilities "TOP" "USER";
#   # imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#   server {
#       listen     localhost:110;
#       protocol   pop3;
#       proxy      on;
#   }
# 
#   server {
#       listen     localhost:143;
#       protocol   imap;
#       proxy      on;
#   }
#}

douyicao2199
douyicao2199 请发布您的服务器配置。
大约 3 年之前 回复
doutuobao4004
doutuobao4004 我重新安装了Wordpress它仍然是一样的。还有别的事吗?
大约 3 年之前 回复
doudou20145
doudou20145 那就是你的nginx.conf文件,你应该发布包含服务器块的文件。尝试做一个新的Wordpress安装,看看它是否很好。可能是您现有的安装只是陷入困境。
大约 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐