Nginx 下载文件而不是重定向

时间:2021-02-04 16:46:54

标签: wordpress nginx

所以我用这个 nginx 配置设置了域:

server {
    root /var/www/reallyuhc.com/html;
    index index.php;
    server_name reallyuhc.com www.reallyuhc.com;

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }

    listen [::]:443 ssl ipv6only=on;
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/reallyuhc.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/reallyuhc.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

server {
    if ($host = www.reallyuhc.com) {
        return 301 https://$host$request_uri;
    }

    if ($host = reallyuhc.com) {
        return 301 https://$host$request_uri;
    }

    listen 80;
    listen [::]:80;
    server_name reallyuhc.com www.reallyuhc.com;
    return 404;
}

现在的问题是,如果我执行 domain.com/index,我会看到索引文件,但执行 domain.com 只会下载该文件。

这里缺少什么?一切正常,只有 / 下载文件而不是显示索引文件。这与Wordpress有关吗?为该域安装了 Wordpress。

0 个答案:

没有答案