Problems with file index.php...in nginx's configuration.

RedWingS

New Member
Joined
Jun 18, 2018
Messages
2
Reaction score
0
Credits
0
Hello.
i have this configuration file with nginx + let's encrypt + php-fpm.
The problem is that when i am going to the browser on site.com....it begins the process of downloading the file index.php....where is my error?
Code:
server {
            server_name site.com;
                        listen 80; # managed by Certbot
                        access_log off;
                        #error_log on;
                        root /home/site.com/ct;
                        index index.php index.html index.htm;
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
        listen   80;
        access_log off;
        error_log on;
        error_log /home/site.com/logs/ct.error.log;
        root /home/site.com/ct;
        # include /etc/nginx/conf/ddos2.conf;
        index index.php index.html index.htm;
        server_name site.com;
        rewrite ^ https://site.com$request_uri? permanent; #301 redirect;
        client_max_body_size 32m;
location / {
        try_files $uri $uri/ /index.php?$args;
}
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                include /etc/nginx/fastcgi_params;
#               fastcgi_pass   unix:/var/run/php5-fpm.sock;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_connect_timeout 250;
                fastcgi_send_timeout 250;
                fastcgi_read_timeout 250;
                fastcgi_buffer_size 256k;
                fastcgi_buffers 4 256k;
                fastcgi_busy_buffers_size 256k;
                fastcgi_temp_file_write_size 256k;
                fastcgi_intercept_errors on;
        fastcgi_param SCRIPT_FILENAME /home/site.com/site$fastcgi_script_name;
        }
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/site.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/site.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
 


Hello, Rob and thank you!
PHP is enabled...because small configuration file works fine. I guess that problem is in code...
 

Members online


Top