0

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

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

由于 nginx 正确加载了 css 和 javascript,somesite.com/看来 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*;

}

4

2 回答 2

1

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

}

注意文档

于 2020-05-19T22:31:34.853 回答
0

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

于 2020-06-15T01:11:59.753 回答