How to configure Orchid control panel, and nginx if needed, so that Orchid loads the javascript and css files?

1k Views Asked by At

How to configure Orchid control panel, and nginx if needed, so that Orchid loads the javascript and css files?

Under ubuntu 18.04 running vesta control panel, Orchid does not load the javascript and css content at somesite.com/dashboard.

Since nginx properly loads the css and javascript at the somesite.com/ it appears that the nginx conf is not causing it.

Any help would be greatly appreciated.

/home/user/conf/web/somesite.com.nginx.conf:

server {
    listen      some-server-ip:443 ssl;
    server_name somedomain.com www.somedomain.com;
    root        /home/user/web/somedomain.com/public;

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

    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/somedomain.com.log combined;
    access_log  /var/log/nginx/domains/somedomain.com.bytes bytes;
    error_log   /var/log/nginx/domains/somedomain.com.error.log error;

    ssl_certificate      /home/user/conf/web/ssl.somedomain.com.pem;
    ssl_certificate_key  /home/user/conf/web/ssl.somedomain.com.key;

    location / {

        # added the following line to allow nginx to recognize laravel dynamically created directories  
    try_files $uri $uri/ /index.php?$query_string;  

        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/]\.php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    127.0.0.1:9002;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   /home/user/web/somedomain.com/document_errors/;
    }

    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    location /vstats/ {
        alias   /home/user/web/somedomain.com/stats/;
        include /home/user/conf/web/somedomain.com.auth*;
    }

    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     /home/user/conf/web/snginx.somedomain.com.conf*;

}

2

There are 2 best solutions below

0
65535 On BEST ANSWER

Solution: orchid.software/en/docs/installation > Publishing resources: php artisan orchid:link.

2
Alexandr Chernyaev On

Orchid relies entirely on Laravel settings

server {
listen 80;
server_name example.com;
root /example.com/public;

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

index index.html index.htm index.php;

charset utf-8;

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$ {
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    include fastcgi_params;
}

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

}

Pay attention to the documentation.