antedebaas / Viesti-Reports

DMARC & SMTP-TLS Reports processor and visualizer and BIMI file hoster
https://hub.docker.com/repository/docker/antedebaas/viesti-reports/general
GNU General Public License v2.0
76 stars 16 forks source link

http(s)://[yourhost]/setup Produces 404 Not Found #142

Closed bcsanford closed 3 weeks ago

bcsanford commented 3 weeks ago

Followed Steps 1-3 from README.md Upon Step 4 http(s)://[yourhost]/setup produces 404 Not Found {root}/public

Are you using the Docker image? No

Database used Not Yet Applicable: MariaDB

Database version used 15.1

Error Messages 2024/08/17 15:29:37 [error] 767084#767084: *5948751 open() "/www/Viesti-Reports/public/setup" failed (2: No such file or directory), client: 32.220.179.247, server: xyz.xyz.com, request: "GET /setup HTTP/2.0", host: "xyz.xyz.com"

Steps to Reproduce Please provide detailed steps to reproduce the problem:

  1. cd /www
  2. git clone https://github.com/antedebaas/Viesti-Reports.git
  3. cd Viesti-Reports
  4. bash update.sh
  5. open http(s)://[yourhost]/setup in the Browser

Expected behavior I Assume a Setup Screen

antedebaas commented 3 weeks ago

What webserver software are you using? If it’s Apache, have you set “Allow Overide All”?

bcsanford commented 3 weeks ago

no i am not using Apache Also, Thank You for the Assistance

nginx version: nginx/1.18.0 (Ubuntu)
built with OpenSSL 1.1.1f  31 Mar 2020
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-lUTckl/nginx-1.18.0=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-compat --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module --add-dynamic-module=/build/nginx-lUTckl/nginx-1.18.0/debian/modules/http-auth-pam --add-dynamic-module=/build/nginx-lUTckl/nginx-1.18.0/debian/modules/http-dav-ext --add-dynamic-module=/build/nginx-lUTckl/nginx-1.18.0/debian/modules/http-echo --add-dynamic-module=/build/nginx-lUTckl/nginx-1.18.0/debian/modules/http-upstream-fair --add-dynamic-module=/build/nginx-lUTckl/nginx-1.18.0/debian/modules/http-subs-filter --add-dynamic-module=/build/nginx-lUTckl/nginx-1.18.0/debian/modules/http-geoip2
PHP 8.3.10 (cli) (built: Aug  2 2024 15:30:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.10, Copyright (c), by Zend Technologies
bcsanford commented 3 weeks ago
server {
    listen x:80;
    listen [xxxx]:80;
    server_name xyz.xyz.com;
    return 301 https://$host$request_uri;
}

server {
    listen x:443 ssl http2;
    listen [xxxx]:443 ssl http2;
    root /www/Viesti-Reports/public;
    server_name xyz.xyz.com;
    index index.php;

    server_tokens off;
    gzip on;

    ssl_certificate /LE/certs/xyz.xyz.com_ecc/fullchain.cer;
    ssl_certificate_key /LE/certs/xyz.xyz.com_ecc/xyz.xyz.com.key;
    ssl_trusted_certificate /LE/certs/xyz.xyz.com_ecc/fullchain.cer;
    ssl_stapling_file /LE/certs/xyz.xyz.com_ecc/xyz.xyz.com.resp;
    ssl_stapling on;
    ssl_stapling_verify on;

        access_log /var/log/nginx/xyz/access.log;
    error_log  /var/log/nginx/xyz/error.log;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";
    add_header Content-Security-Policy "default-src 'none'; style-src 'self'; img-src 'self'; script-src 'self'; connect-src 'self'; media-src 'self'; form-action 'self'; base-uri 'none'; frame-ancestors 'none'";
    add_header Permissions-Policy "interest-cohort=()";
    add_header Referrer-Policy "no-referrer";
    add_header Strict-Transport-Security "max-age=31536000";

    # Well known routes

    location /robots.txt {
        return 200 "User-agent: *\nDisallow: /";
    }

    location = /favicon.ico {
        log_not_found off; access_log off;
        return 410 "";
    }

    location ~ /apple-touch-icon(|-\d+x\d+)(|-precomposed).png {
        log_not_found off; access_log off;
        return 410 "";
    }

    # App routes

    location ~ ^/(css|js)/ {
        access_log off;
        expires 1d;
    }

    location ~ ^/(utils|classes|config)/ {
        deny all;
    }

    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

    fastcgi_pass unix:/run/php/php8.3-fpm.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    include fastcgi_params;
    }

}
antedebaas commented 3 weeks ago

Add the following (I think)

location / {

First attempt to serve request as file, then

        # as directory, then fall back to index.php
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

see https://github.com/antedebaas/Viesti-Reports/blob/main/dockerfiles/etc/nginx/nginx.confor more nginx config stuff

bcsanford commented 3 weeks ago

thank you, that solved that issue, onto the next issue