Nginx下载索引php而不是在Wordpress网站中提供它

时间:2019-02-07 11:23:55

标签: wordpress nginx

正如标题所述,nginx下载索引php。 我有一个wordpress网站,并且已经为我的域发布了ssl证书。

只需提一下,如果我转到https://example.com/index.php,它将转到主页并按预期工作,但是如果我转到https://example.com,它将下载index.php文件。

下面是我的服务器上下文:

server {
listen 443;

ssl on;

ssl_certificate /etc/nginx/ssl/bundle.crt;

ssl_certificate_key /etc/nginx/ssl/priv.key;



ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4";

server_name example.com www.example.com;

root /var/www/mywebsite/;

index index.php index.html index.htm index.nginx-debian.html;

 location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?q=$uri&$args;
limit_req zone=myzone burst=200;
  }

rewrite wp-content/uploads(/_pda/.*\.\w+)$ "/index.php?pda_v3_pf=$1" last;
rewrite private/([a-zA-Z0-9-_]+)$ "/index.php?pda_v3_pf=$1&pdav3_rexypo=ymerexy" last;

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;

location = /50x.html {
   root /usr/share/nginx/html;
  } 

location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include snippets/fastcgi-php.conf;
 }

location ~* (\.css|\.pdf)$ {
valid_referers blocked irir.lv;
if ($invalid_referer) {
return 444;
  }
}

location ~*  \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
expires 365d;
}

location ~ /\.ht {
deny all;
}
}

任何帮助将不胜感激

0 个答案:

没有答案