sabre-io / Baikal

Baïkal is a Calendar+Contacts server
https://sabre.io/baikal/
GNU General Public License v3.0
2.42k stars 281 forks source link

Front-end static page lost #1253

Open pptfz opened 3 months ago

pptfz commented 3 months ago

Baikal version: 0.x

Problem:

My browser visits the deployed project and finds no front-end style image

Here is my nginx configuration file I am now deploying this service in k8s and forwarding it through an nginx (installed in vm), what is wrong with my configuration file

server {
  listen       80;
  server_name  domain;

  root  /opt/vipkid/baikal/html;
  index index.php;

  rewrite ^/.well-known/caldav /dav.php redirect;
  #rewrite ^/$ /dav.php redirect;
  rewrite ^/.well-known/carddav /dav.php redirect;

  dav_methods PUT DELETE MKCOL COPY MOVE;

  location ~ /(\.ht|Core|Specific|config) {
    deny all;
    return 404;
  }

  charset utf-8; 

  location ~ ^(.+\.php)(.*)$ {
    try_files $fastcgi_script_name =404;
    include        /etc/nginx/fastcgi_params;
    fastcgi_split_path_info  ^(.+\.php)(.*)$;
    fastcgi_pass  10.246.214.34:9000;
    fastcgi_index index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;
  }
}
pptfz commented 3 months ago

I refer to baikal-docker The configuration file of nginx in ckulka/baikal: 0.94-nginx provided by the project is configured, but access is still problematic

server {
  listen 80;
  server_name mydomain;

  root   /opt/vipkid/baikal/html;
  index index.php;

  rewrite ^/.well-known/caldav /dav.php redirect;
  rewrite ^/.well-known/carddav /dav.php redirect;

  charset utf-8;

  location ~ /(\.ht|Core|Specific) {
    deny all;
    return 404;
  }

  location ~ ^(.+\.php)(.*)$ {
    try_files $fastcgi_script_name =404;
    include        /etc/nginx/fastcgi_params;
    fastcgi_split_path_info  ^(.+\.php)(.*)$;
    #fastcgi_pass   unix:/var/run/php-fpm.sock;
    fastcgi_pass  10.246.214.34:9000;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;
  }

  location ~ /.ht {
    deny all;
  }
}

image

pptfz commented 3 months ago

I re-installed nginx version 1.20 on centos7, reconfigure, why is the access result still 404

server {
  listen 80;
  server_name mydomain;

  root   /opt/vipkid/baikal/html;
  index index.php;

  rewrite ^/.well-known/caldav /dav.php redirect;
  rewrite ^/.well-known/carddav /dav.php redirect;

  charset utf-8;

  location ~ /(\.ht|Core|Specific) {
    deny all;
    return 404;
  }

  location ~ ^(.+\.php)(.*)$ {
    try_files $fastcgi_script_name =404;
    include        /etc/nginx/fastcgi_params;
    fastcgi_split_path_info  ^(.+\.php)(.*)$;
    #fastcgi_pass   unix:/var/run/php-fpm.sock;
    fastcgi_pass  10.246.214.34:9000;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;
  }

  location ~ /.ht {
    deny all;
  }
}

image