使用 H5AI 时,Nginx 未执行 php 文件

使用 H5AI 时,Nginx 未执行 php 文件

我正在尝试在我的 Debian 8 服务器上安装 H5AI,我正在使用 NGINX 和 PHP7,当我尝试访问我的地址(在本例中为 share.chaton-poulpe-pieuvre.tk)时,它让我下载文件,但它没有执行它。

我的H5AI文件在/usr/share/nginx/share,这个目录下有H5AI的public和private目录,这是H5AI的0.29.0版本。

这是我的 H5AI 的 nginx.conf 文件:

server {
        listen       80;
        server_name  share.chaton-poulpe-pieuvre.tk;
        return 301 https://share.chaton-poulpe-pieuvre.tk$request_uri;
}
server {
        server_name  share.chaton-poulpe-pieuvre.tk;
        listen 443 ssl http2;
        root /usr/share/nginx/share;
        index index.html index.php /public/index.php;
        ssl_certificate /etc/letsencrypt/live/chaton-poulpe-pieuvre.tk/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/chaton-poulpe-pieuvre.tk/privkey.pem;
        ssl_trusted_certificate /etc/letsencrypt/live/chaton-poulpe-pieuvre.tk/chain.pem;

        ssl_protocols TLSv1.2;
        ssl_ecdh_curve secp384r1;
        ssl_ciphers EECDH+AESGCM:EECDH+AES;
        ssl_prefer_server_ciphers on;
        ssl_stapling on;
        ssl_stapling_verify on;
        resolver 80.67.169.12 80.67.169.40 valid=300s;
        resolver_timeout 5s;

         location ~ \.php$ {
            try_files $uri =404;
            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;
            fastcgi_intercept_errors on;
            fastcgi_ignore_client_abort off;
            fastcgi_connect_timeout 60;
            fastcgi_send_timeout 180;
            fastcgi_read_timeout 180;
            fastcgi_buffers 4 256k;
            fastcgi_buffer_size 128k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
           }

        autoindex on;

}

谢谢大家的帮助。

答案1

尝试index index.html index.php /_h5ai/public/index.php;

相关内容