log_format custom '$remote_addr - [$time_iso8601] "$request" $status $body_bytes_sent $request_time "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';

server {
    listen 8080;
    server_name _;
    index index.html index.php;
    root /var/www/html;
    
    access_log /var/log/nginx/localhost.access.log custom;
    error_log /var/log/nginx/localhost.error.log warn;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.1-fpm.sock;
    }
}
