server {
    client_max_body_size 210M;
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html/puninar-logistic;
    index index.php index.html index.htm;
    server_name _;

    location /venproice {
        alias /var/www/html/venproice/public;
        try_files $uri $uri/ @venproice;
    }

    location @venproice {
        rewrite ^/venproice/(.*)$ /venproice/index.php?/$1 last;
    }

    location ~ ^/venproice/(.+\.php)$ {
        alias /var/www/html/venproice/public/$1;
        fastcgi_pass unix:/run/php/php8.5-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
    }

    location /bilinggo {
        alias /var/www/html/bilinggo/public;
        try_files $uri $uri/ @bilinggo;
    }

    location @bilinggo {
        rewrite ^/bilinggo/(.*)$ /bilinggo/index.php?/$1 last;
    }

    location ~ ^/bilinggo/(.+\.php)$ {
        alias /var/www/html/bilinggo/public/$1;
        fastcgi_pass unix:/run/php/php8.5-fpm.sock;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $request_filename;
    }

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php8.5-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.ht { deny all; }
    location ~ /\.env { deny all; }
}
