Skip to main content

BookStack 改為子目錄

NGINX設定

修改/etc/nginx/conf.d/bookstack.conf

server {
  listen 8080;
  listen [::]:8080;

  server_name _;

  root /var/www/html/bookstack/public;
  index index.php index.html;

  location / {
    try_files $uri $uri/ /index.php?$query_string;
  }
  location ~ \.php$ {
    include fastcgi_params;
    fastcgi_pass unix:/run/php/php8.4-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}


server {
  listen 80;
  listen [::]:80;

  server_name _;

  root /var/www/html;
  index index.html;

  location /bookstack/ {
    proxy_pass http://localhost:8080/;
    proxy_redirect off;
  }
  
}
nginx -t

service nginx restart

http://ip/bookstack