Blesta nginx Template

Please help me, I need nginX Template for Blesta Billing…

Please describe your problem in detail!

1 Like

Some files not loading when Blesta need -
Uploads Directory to - /home/user/web/domain/uploads/
&
Log Directory - /home/user/web/domain/logs_blesta/

Please post a detailed error log.

1 Like

When Upload Logo, nothing Showing on Website…

But File upload to - web/user/domain/uploads/ Folder / Sub-Folder.

This is error log, but i dont found any solution from this error.

Bleasta need uploads & logs_blesta Folder with Sub-Folders – outside the root web directory (public_html)

so i need nginx Template for this… :frowning: :frowning: :frowning:

I think you got it wrong. All website files are inside public_html directory. Please upload your files inside public_html directory, uploads all files inside. public_html is the root directory of all website domains.

Please extract all the files in the blesta-5.10.0.zip compressed package into the public_html directory. This is the only way it can work. If it is outside the public_html directory, you need to modify all the configurations, which is too much work and does not conform to the working method of hestia!

Please remember that the domain root of hestia is public_html. If you want to specify a different root, please specify it in the public_html folder. This is the default way virtual hosts work! If you have other questions, please continue to submit them!

1 Like

I’ve Already Contact Blesta -
They solved some errors, and told me i need to Configure nginx properly -

Now when i’ve try to Set Uploads Directory to /home/kholifa/web/kholifa.net/public_html/uploads - then got this error messages –

The uploads folder of the upload directory should be in public_html. You need to specify that the website running directory is in the public_html/blesta folder so that it does not conflict.

1 Like

So i need install blesta on Sub-Directory on public_html/blesta ??

Yes, that’s right!

The complete operation should be to extract

to the public_html folder.
Then specify the blesta folder as the main web access directory. Please refer to the advanced options in the domain

1 Like

this is not a solution Brother… :frowning:
i want use blesta to my main Domain (not want use sub-Directory)… :frowning:

public_html is your main domain root directory

1 Like

You don’t understand the relationship between the root directories of domain names. Blesta is just a PHP program. If you want to set a different folder, please modify the configuration file of the corresponding domain name in /home/www/conf of your domain name.

1 Like

I’ve try as per your Image, and Installed,
but when try to Set – Uploads Directory - /home/kholifa/web/kholifa.net/public_html/uploads then got Error, and Uploads Directory path are Reset with Error Message - The upload directory must exist and be outside the root web directory. :frowning: :frowning:

Then Contact Blesta they setup all directory and Files, just missing nginx configuration… :frowning:

Please refer to the configuration file modification in the /conf/web/ directory under /home/username. It is recommended to perform a backup file operation before modification.

This is very unreasonable, it should be in the blesta folder. I don’t understand how it works, if you need to change the configuration, please refer to the path above

1 Like

Again i’ve move all files as your Screenshot, rename blesta to application and config nginx Template tpl -

server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;

include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;

# Security: Prevent access to hidden files
location ~ /\.(?!well-known\/) {
    deny all;
    return 404;
}

# Main location block
location / {
    try_files $uri @application;
    rewrite ^(.*)/install\.php$ /$1/install/ redirect;
}

# PHP-FPM configuration for index.php
location = /index.php {
    try_files $uri =404;

    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass %backend_lsnr%;
    include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
}

# Security: Block access to certain file types
location ~ /\. {
    log_not_found off;
    return 404;
}

location ~* \.(php|pdt|txt)$ {
    log_not_found off;
    return 404;
}

# Serve files from the uploads directory
location /uploads/ {
    alias /home/kholifa/web/kholifa.net/public_html/uploads/;
    try_files $uri $uri/ =404;
    access_log off;
}

# Error handling
location /error/ {
    alias %home%/%user%/web/%domain%/document_errors/;
}

# Stats
location /vstats/ {
    alias %home%/%user%/web/%domain%/stats/;
    include %home%/%user%/web/%domain%/stats/auth.conf*;
}

# Include additional configurations
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include %home%/%user%/conf/web/%domain%/nginx.conf_*;


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

}

Please Check is this tpl Template are ok?

I’ve Fixed all Problems…

Thanks for your Help…

It is my honor to help you solve your urgent problem. I wish you a happy use of hestia