A
A
Andrey2021-02-01 16:33:46
PHP
Andrey, 2021-02-01 16:33:46

nginx config, can't start website?

Hello everyone, I can not start postfixadmin data - lies /var/www/postfixadmin nginx config/conf.d/
postfixadmin.conf

listen       80;
        server_name  postfixadmin.mail.crystall;
        set $root_path /var/www/postfixadmin;

        location / {
                root $root_path;
                index index.php;
        }

        location ~ \.php$ {
                #fastcgi_pass 127.0.0.1:9000;
                fastcgi_pass unix:/run/php-fpm/www.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
                include fastcgi_params;
                fastcgi_param DOCUMENT_ROOT $root_path;
                fastcgi_read_timeout 300;
        }
}


here is the default nginx/nginx.conf config

spoiler
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    server_names_hash_bucket_size 64;

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

     location ~ \.php$ {
        set $root_path /usr/share/nginx/html;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
        include fastcgi_params;
        fastcgi_param DOCUMENT_ROOT $root_path;
    }

        location / {
        index  index.php index.html index.htm;
    }

        error_page 404 /404.html;
           location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }


dns entry added, firewall turned off, silence in the logs
nearby phpmyadmin lives with exactly the same config and works fine

where did I go wrong? just learning nginx

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question