wordpress - Nginx 下载 index php 而不是在 Wordpress 站点中提供它
问题描述
正如标题所说,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;
}
}
任何帮助将非常感激
解决方案
推荐阅读
- pycharm - 如何更改专用于 pycharm 的内存量?
- python - 从不属于单词的字符串列表中删除标点符号
- c - 我的快速排序无法正常工作。我做错了什么?
- csv - 使用 Unix 将复杂的 Excel 工作表数据转换为 csv 文件
- oracle-sqldeveloper - 如何在声明块中使用变量?
- jenkins - 无法在 Jenkins groovy 中进行减法运算
- arduino - 试图检测每个脉冲的最大时间
- swift - 如何解决“keyWindow”在 iOS 13 中被贬低(自动布局)
- nginx - 如何在使用 CodePipeline 时使用 .ebextension
- nginx - 在 nginx 中获取别名重定向规则的 500 内部错误