dongzanghua8422 2016-09-29 06:40
浏览 55

使用Nginx和Wordpress找不到404

Hi I have a website using wordpress on nginx, I have a 404 Not Found error when accessing to it. https://kilobytes.fr I'm using a VPS from ScaleWay and my domain is with CloudFlare (Full SSL (Strict)).

Here is the conf of my website:

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";
}

and here is the conf of 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/*;
}

My root folder for wordpress is : /usr/share/nginx/html/

I tried a lot of things and nothing worked.. Thanks !

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
    • ¥20 易康econgnition精度验证
    • ¥15 msix packaging tool打包问题
    • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致