如何配置 Orchid 控制面板和 nginx(如果需要),以便 Orchid 加载 javascript 和 css 文件?

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

如何配置 Orchid 控制面板和 nginx(如果需要),以便 Orchid 加载 javascript 和 css 文件?

在 ubuntu 18.04 运行 vesta 控制面板下,Orchid 不会在 somesite.com/dashboard.

加载 javascript 和 css 内容

由于 nginx 在 somesite.com/ 正确加载了 css 和 javascript,看来不是 nginx conf 引起的。

如有任何帮助,我们将不胜感激。

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

}

Orchid 完全依赖于 Laravel 设置

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

}

关注documentation

解决方案:orchid.software/en/docs/installation > 发布资源:php artisan orchid:link.