VPS Deployment & Nginx Architecture
The Planovi Microservices are hosted on the Planovi Linux VPS (191.218.165.149) behind an Nginx reverse proxy running PHP 8.3 FPM.
1. Nginx Virtual Host Configuration
Each subdomain is routed to the respective subdirectory within the microservices deployment:
server { listen 443 ssl http2; server_name dev-dealflow.planovi.app dealflow.planovi.app;
root /var/www/planovi-microservices/dealflow; index index.php offer.php inquiry.php;
ssl_certificate /etc/letsencrypt/live/planovi.app/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/planovi.app/privkey.pem;
location / { try_files $uri $uri/ =404; }
# Protect internal data directory from direct web access location ^~ /data/ { deny all; return 403; }
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }}server { listen 443 ssl http2; server_name dev-scheduler.planovi.app scheduler.planovi.app;
root /var/www/planovi-microservices/scheduler; index index.php;
ssl_certificate /etc/letsencrypt/live/planovi.app/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/planovi.app/privkey.pem;
location / { try_files $uri $uri/ /index.php?$query_string; }
# Protect internal data directory from direct web access location ^~ /data/ { deny all; return 403; }
location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php8.3-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }}2. Directory Permissions
The PHP-FPM worker process runs under the www-data user on Ubuntu/Debian. The dynamic data/ directories must be writable:
# Set ownership to web server usersudo chown -R www-data:www-data /var/www/planovi-microservices/dealflow/datasudo chown -R www-data:www-data /var/www/planovi-microservices/scheduler/data
# Grant read/write permissions to directorysudo chmod -R 775 /var/www/planovi-microservices/dealflow/datasudo chmod -R 775 /var/www/planovi-microservices/scheduler/data3. Continuous Deployment via Webhooks
Updates pushed to main or develop trigger automatic updates on the VPS via the deployment webhook listener:
git pull origin maincd scheduler && composer install --no-dev --optimize-autoloadersudo systemctl reload php8.3-fpm