我尝试安装Baïkal在带有“常规包”的专用主机上。我使用 Nginx 作为网络服务器,但无法运行它。官方docs仅专用于在子域 ( http://baikal.mydomain.com ) 上运行 Baikal,而不是在子目录 ( http://mydomain.com/baikal ) 中运行。当我打开 http://mydomain.com/baikal/card.php/addressbooks/IstMe/default/我只收到“找不到文件”。任何帮助将不胜感激。
我的 nginx.conf 看起来像这样:
location /baikal {
alias /usr/share/webapps/baikal/html;
index index.php;
rewrite ^/.well-known/caldav /cal.php redirect;
rewrite ^/.well-known/carddav /card.php redirect;
location ~ ^/baikal/(.+\.php)$ {
alias /usr/share/webapps/baikal/html/$1;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
}
location ~* /baikal/(\.ht|Core|Specific) {
deny all;
return 404;
}
最佳答案
我也遇到了同样的问题。以下非常简单的实例配置来自this article对我来说非常有用:
server {
listen [::]:443 ssl;
server_name yourdomain.tld;
root /usr/share/nginx/baikal/html;
index index.php;
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
rewrite ^/.well-known/caldav /cal.php redirect;
rewrite ^/.well-known/carddav /card.php redirect;
charset utf-8;
location ~ /(\.ht|Core|Specific) {
deny all;
return 404;
}
location ~ ^(.+\.php)(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
关于php - 无法让贝加尔在子目录中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22020754/