# EXAMPLE ONLY. Replace every /VERIFIED/... path and PHP-FPM socket after staging review.
# Include these exact locations before generic static/index handling.

location = /texas/dallas/plumbing { return 308 /texas/dallas/plumbing/$is_args$args; }
location ~ ^/pro/(demo-aqualine-plumbing-dallas-tx|demo-blue-valve-plumbing-dallas-tx|demo-clear-route-plumbing-dallas-tx|demo-copper-junction-plumbing-dallas-tx|demo-plumbing-company-dallas-tx|demo-north-grid-plumbing-dallas-tx)$ {
    return 308 $uri/$is_args$args;
}

location = /texas/dallas/plumbing/ {
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /VERIFIED/PLOCAL/backend/public/index.php;
    fastcgi_param SCRIPT_NAME /index.php;
    fastcgi_pass unix:/VERIFIED/PHP_FPM_SOCKET;
}

location ~ ^/pro/(demo-aqualine-plumbing-dallas-tx|demo-blue-valve-plumbing-dallas-tx|demo-clear-route-plumbing-dallas-tx|demo-copper-junction-plumbing-dallas-tx|demo-plumbing-company-dallas-tx|demo-north-grid-plumbing-dallas-tx)/$ {
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME /VERIFIED/PLOCAL/backend/public/index.php;
    fastcgi_param SCRIPT_NAME /index.php;
    fastcgi_pass unix:/VERIFIED/PHP_FPM_SOCKET;
}

location ^~ /assets/ {
    alias /VERIFIED/PLOCAL/assets/;
    try_files $uri =404;
}

location ^~ /backend/ { return 404; }
location ~* ^/(?:PLOCAL_.*\.(?:txt|md)|deploy/|tools/|\.) { return 404; }

# Existing production static handling follows these rules.
# Rollback: remove/disable only the exact Market/Profile locations above and reload Nginx.
