mardi 2 février 2021

I have the 502 error Bad Gateway with Nginx and PHP

I have a problem with Nginx and PHP. When I open one of my php pages, I get the error "502 Bad Gateway" which appears and even after several searches I cannot resolve it. However, I have made the necessary modifications in the file "default" dans /etc/nginx/sites-available :

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

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }
 }

        # pass PHP scripts to FastCGI server
        #
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
#               fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
                # With php-cgi (or other tcp sockets):
                fastcgi_pass 127.0.0.1:9000;
        #} ``` 




Aucun commentaire:

Enregistrer un commentaire