The Server Sync option allows to sync your Brizy Cloud project on your own infrastructure/server in real time.
API Explorer: https://[your-white-label-dashboard-domain]/api/doc/v2 (to access the correct link please replace [your-white-label-dashboard-domain] with the domain you gave us in the on-boarding process for your White Label setup)
Requirements
- PHP version: 7.4 or higher;
- PHP extensions: json, fileinfo, http
- Webserver: Apache or Nginx
Step 1. Download the zip via API endpoint https://admin.brizy.io/api/doc/v2#get--api-{version}-projects-{project}-sync-download
Step 2. Unpack the ZIP you just downloaded, and inside the folder you'll find a bunch of folders and files.
Step 3. Web Server Configuration
- Apache Configuration
<IfModule mod_rewrite.c>
RewriteEngine on
# --- Redirect from http to https
#RewriteCond %{HTTPS} off
#RewriteCond %{HTTP:X-Forwarded-Proto} !https
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# ---
# --- Redirect from non-www to www
#RewriteCond %{HTTP_HOST} !^www. [NC]
#RewriteRule ^ %{REQUEST_SCHEME}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# ---
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ %2index.php?page=$0&%{QUERY_STRING} [QSA,L]
</IfModule>- Nginx Configuration
If your server uses NGINX webserver software instead of Apache, it will be necessary to setup some configuration rules into nginx.conf.
Nginx provides much more flexibilty in configuration, so it is hard to provide configuration lines that will be working on any webserver. These lines below are just and example on what must be done to get things working.
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /var/www/html;
location / {
# try to serve file directly, fallback to index.development
try_files $uri /index.development$is_args$args;
}
location ~ ^/index\.development(/|$) {
# when using PHP-FPM as a unix socket
#fastcgi_pass unix:/sock/development-fpm.sock;
# when PHP-FPM is configured to use TCP
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.development)(/.*)$;
include fastcgi_params;
# optionally set the value of the environment variables used in the application
# fastcgi_param APP_ENV prod;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
# Caveat: When PHP-FPM is hosted on a different machine from nginx
# $realpath_root may not resolve as you expect! In this case try using
# $document_root instead.
#fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /var/www/html/index.php;
fastcgi_param DOCUMENT_ROOT $realpath_root;
# Prevents URIs that include the front controller. This will 404:
# http://example.com/index.php/some-path
# Remove the internal directive to allow URIs like this
internal;
}
# return 404 for all other development files not matching the front controller
# this prevents access to other development files you don't want to be accessible.
location ~ \.development$ {
return 404
}
error_log /var/log/nginx/project_error.log;
access_log /var/log/nginx/project_access.log;
}Step 4. Upload the files on your server. The files should be copied to your public HTML directory - this is the directory where your home page is located: 'html', 'public_html', 'www'.
Step 5. Setting Permission for a File or a Folder
Folder permissions should be set to 755, and file permissions need to be set to 644.
Step 6. Open in your web browser: https://www.your-domain.site to begin the install and synchronization process.
From now on, when you modify something in your Brizy Cloud project and press the Update button, it will get synced automatically on your server.
Managing Domains in Brizy Cloud Projects with a Server Sync Publish Option
Domain Connection / Reconnection API
Step 1. Disconnect Domain
If a domain is completely unavailable (not resolving, not working at all), you must call:
Use the API documentation: https://admin.brizy.io/api/doc/v2#get--api-%7Bversion%7D-projects-%7Bproject%7D-sync-disconnect
Purpose:
- Detaches the domain from the project.
- Used only when the domain is no longer active.
Step 2. Reconnect Domain
https://example.com/cloud/reconnect - where example.com is your Project Server Sync Domain
Purpose:
-
Reassign or connect a domain to a project. Supported scenarios:
-
Add a new domain
Attach a domain that was not previously linked to the project.
-
Replace domain A with domain B
The current project domain is replaced with another one.
-
Swap domains between projects
Example: Project 1 has domain A Project 2 has domain B After reconnect: Project 1 will have domain B Project 2 will have domain A
-
Add a new domain
Project Sync Status API
Overview
The Project Sync Status API allows you to check whether a project is currently online, offline, or unreachable. This is particularly useful for monitoring the deployment status of your projects.
API Endpoint
API Documentation: Sync Status Endpoint
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| projectId | string | The unique identifier of the project |
Response
The API returns a JSON object with the following structure:
{
"status": "string"
}
Status Values
The status field can have one of the following values:
-
online: The project is successfully deployed and accessible -
offline: The project has not been deployed (no export deploy URL) -
unreachable: The project has been deployed but cannot be reached or verified
Response Codes
| Code | Description |
|---|---|
| 200 | Request successful |
| 400 | Bad request - Invalid syntax |
| 404 | Project not found |
| 500 | Internal server error |
Use Cases
- Monitoring project deployment status
- Verifying successful project synchronization
- Troubleshooting deployment issues
