Search code examples
laravelnginxdynamicsubdirectoryvesta

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


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*;

}


Solution

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