Почему выходит ошибка "File not found"

https://rusnewz.ru/ -> File not found

rusnewz-ru-nginx.conf

server {
        listen 80;
        listen [::]:80;

        server_name rusnewz.ru www.rusnewz.ru;

        location ~ /.well-known/acme-challenge {
                allow all;
                root /var/www/html/rusnewzru;
        }

        location / {
                rewrite ^ https://$host$request_uri? permanent;
        }
}

server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        server_name rusnewz.ru www.rusnewz.ru;

        index index.php index.html index.htm;

        root /var/www/html/rusnewzru;

        server_tokens off;

        ssl_certificate /etc/letsencrypt/live/rusnewz.ru/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/rusnewz.ru/privkey.pem;

        include /etc/nginx/conf.d/options-ssl-nginx.conf;

        add_header X-Frame-Options "SAMEORIGIN" always;
        add_header X-XSS-Protection "1; mode=block" always;
        add_header X-Content-Type-Options "nosniff" always;
        add_header Referrer-Policy "no-referrer-when-downgrade" always;
        add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
        # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
        # enable strict transport security only if you understand the implications

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass newscaster_rusnewzru:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_path_info;
        }

        location ~ /\.ht {
                deny all;
        }

        location = /favicon.ico {
                log_not_found off; access_log off;
        }
        location = /robots.txt {
                log_not_found off; access_log off; allow all;
        }
        location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
                expires max;
                log_not_found off;
        }

        error_log /var/www/log/nginx/error.log;
        access_log /var/www/log/nginx/access.log;
}

docker-compose.yml

version: '3.1'

services:

#
# common
#

  webserver:
    depends_on:
      - newscaster_rusnewzru
    image: nginx
    container_name: webserver
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./apps/rusnewzru:/var/www/html/rusnewzru # rusnewz.ru
      - ./data/log:/var/www/log
      - ./server/nginx-conf:/etc/nginx/conf.d
      - ./server/ssl:/etc/letsencrypt
    networks:
      - ainewz-network

#
# rusnewz.ru
#

  newscaster_rusnewzru:
    image: wordpress:php8.3-fpm
    container_name: newscaster_rusnewzru
    restart: always
    depends_on:
      - db_rusnewzru
    env_file: .env
    ports:
      - "8081:80"
    environment:
      WORDPRESS_DB_HOST: db_rusnewzru
      WORDPRESS_DB_NAME: $MYSQL_DATABASE
      WORDPRESS_DB_USER: $MYSQL_USER
      WORDPRESS_DB_PASSWORD: $MYSQL_PASSWORD
    volumes:
      - ./apps/rusnewzru:/var/www/html
    networks:
      - ainewz-network

  db_rusnewzru:
    image: mysql:8.0
    container_name: db_rusnewzru
    restart: always
    env_file: .env
    volumes:
      - ./data/rusnewzru:/var/lib/mysql
    networks:
      - ainewz-network
    command: '--default-authentication-plugin=caching_sha2_password'

networks:
  ainewz-network:
    driver: bridge

nginx/access.log

X.X.X.X - - [15/Aug/2024:04:20:52 +0000] "GET / HTTP/2.0" 404 16 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"

nginx/error.log пустой

Файлы на сервере и в обоих контейнерах есть. Статику открывает https://rusnewz.ru/test.html Проблема именно с PHP, но не понимаю, где ошибка. Помогите, пожалуйста.


Ответы (0 шт):