使用Nginx和Wordpress找不到404

时间:2016-09-29 06:40:54

标签: php wordpress nginx

您好我在nginx上有一个使用wordpress的网站,访问它时遇到404 Not Found错误。 https://kilobytes.fr 我正在使用ScaleWay的VPS,我的域名使用CloudFlare(完整SSL(严格))。

以下是我网站的内容:

server {
 listen 80;
 root /usr/share/nginx/html;
 index index.php;
 server_name kilobytes.fr www.kilobytes.fr;
 return 301 https://$server_name$request_uri; #Redirection
 access_log /var/log/nginx/kilobytes.fr.access_log;
 error_log /var/log/nginx/kilobytes.fr.error_log;

location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
 }

location ~ \.php$ {
 try_files $uri $uri/ /index.php?q=$uri&$args;
 fastcgi_pass unix:/run/php/php7.0-fpm.sock;
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
 satisfy any;
 allow all;
}

}

server {
 listen 443 ssl http2;
 server_name kilobytes.fr wwww.kilobytes.fr;
 ssl_protocols TLSv1.2;
 ssl_certificate /etc/letsencrypt/live/kilobytes.fr/fullchain.pem;
 ssl_certificate_key /etc/letsencrypt/live/kilobytes.fr/privkey.pem;


 ## Diffie-Hellman
 ssl_ecdh_curve secp384r1;

 ## Ciphers
 ssl_ciphers EECDH+AESGCM:EECDH+AES;
 ssl_prefer_server_ciphers on;

 # OCSP Stapling
 ssl_trusted_certificate /etc/letsencrypt/live/kilobytes.fr/chain.pem;
 resolver 80.67.169.12 80.67.169.40 valid=300s;
 resolver_timeout 5s;
 ssl_stapling on;
 ssl_stapling_verify on;

 ## TLS parameters
 ssl_session_cache shared:SSL:10m;
 ssl_session_timeout 5m;
 ssl_session_tickets off;

 ## HSTS
 add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; preload";
}

这是nginx的配置:

user www-data;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


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

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    gzip  on;
    client_max_body_size 100M;
    server_tokens off;
    include /etc/nginx/sites-enabled/*;
}

我的wordpress根文件夹是:/ usr / share / nginx / html /

我尝试了很多东西而没有任何效果......谢谢!

0 个答案:

没有答案