Skip to main content

Deploying your application

important

🚀 Deployment Guide: For a full guide on deploying your application, see how.qlic.nl.

We recommend you start there for detailed instructions on setting up both frontend and backend.

There’s no single required method for deploying your app; however, it’s recommended to host the frontend and backend as separate virtual hosts, ideally on the same server.

caution

In order to make sure sessions are cleaned up, you need to enable cronjobs.

Please see Sessions for more info

Building the Frontend​

Quasar offers multiple ways to build your app. The simplest option is to create a web version.

Building a web version​

  1. Update your .env files for both the backend and frontend to reflect the new endpoints.
  2. Then, to build the web version, run:
    quasar build
  3. After building, Quasar will publish all files to the dist/spa directory.

Preparing the Backend​

For detailed instructions on preparing the application’s backend for production, refer to the Laravel Deployment Guide.

Setting up Virtual Hosts (vhosts)​

Ngninx Configuration​

After pulling the production build for both your backend and frontend, you can set up virtual hosts as shown in the examples below.

Example vhost for the Laravel backend:​

/etc/nginx/sites-enabled/qore-api.qlic.dev
server {
listen 80;
listen [::]:80;

root /var/www/qore-api.qlic.dev/public;
index index.php;

charset utf-8;

server_name qore-api.qlic.dev www.qore-api.qlic.dev;

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

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }

error_page 404 /index.php;

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

error_page 404 /index.php;

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

location ~ /\.(?!well-known).* {
deny all;
}

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/qore-api.qlic.dev/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/qore-api.qlic.dev/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

Example vhost for the Quasar Frontend:​

/etc/nginx/sites-enabled/qore-frontend.qlic.dev
server {
server_name qore-frontend.qlic.dev;

root /var/www/qore-api.qlic.dev/frontend/dist/spa;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

index index.html;

charset utf-8;

location / {
try_files $uri $uri/ /index.html;
}

location = /robots.txt { access_log off; log_not_found off; }

#access_log off;
#error_log /var/log/nginx/qore-frontend.qlic.dev-error.log error;

location ~ /\.(?!well-known).* {
deny all;

listen [::]:443 ssl; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/qore-frontend.qlic.dev/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/qore-frontend.qlic.dev/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
if ($host = qore-frontend.qlic.dev) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;
listen [::]:80;
server_name qore-frontend.qlic.dev;
return 404; # managed by Certbot
}