T
T
Togzi2022-04-19 08:53:16
Nginx
Togzi, 2022-04-19 08:53:16

What to do, because of the nginx config, openserver does not start?

I'm transferring a file from the hosting, using cfg, but the server does not start, what could be the problem?

Apache_2.4-PHP_8.0-8.1+Nginx_1.21_vhostn.conf

server {
   charset utf-8;
   client_max_body_size 128M;
   sendfile off;

   listen 80; ## listen for ipv4
   #listen [::]:80 default_server ipv6only=on; ## listen for ipv6

   server_name admin;
   index       index.php;
   root /domains/admin/admin;
     
   location / {
       # Redirect everything that isn't a real file to index.php
       try_files $uri $uri/ /index.php$is_args$args;
     
       location ~ \.php$ {
           include fastcgi_params;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           #fastcgi_pass   127.0.0.1:9000;
           fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
           try_files $uri =404;
       }
   }

   # Static files location
   location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js)$ {
        access_log off;
        expires 30d;
   }
      

   location ~ /\.(ht|svn|git) {
       deny all;
   }
}


the old config, which starts, but displays a 404 error:
server {
   charset utf-8;
   client_max_body_size 128M;
   sendfile off;

   listen 80; ## listen for ipv4
   #listen [::]:80 default_server ipv6only=on; ## listen for ipv6

   server_name admin;
   index       index.php;
   root /home/vostok/www/videokot/admin;

   location / {
       # Redirect everything that isn't a real file to index.php
       try_files $uri $uri/ /index.php$is_args$args;

       location ~ \.php$ {
           include fastcgi_params;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           #fastcgi_pass   127.0.0.1:9000;
           fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
           try_files $uri =404;
       }
   }

   # Static files location
   location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js)$ {
        access_log off;
        expires 30d;
   }


   location ~ /\.(ht|svn|git) {
       deny all;
   }
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2022-04-19
@karabanov

nginx -twill show where the error is in the config.

Z
Zerg89, 2022-04-19
@Zerg89

Set up permissions to the folder, it seems that the socket cannot be created (stop it's windows there are no sockets,
proxy pass 127.0.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question