Files
nginx-serve/conf/book_catalog.conf
Edward Langley 775467da51 Rename project from nginx-test to sqlite-serve
- Updated package name in Cargo.toml: nginx-test → sqlite-serve
- Updated library name: libnginx_test.dylib → libsqlite_serve.dylib
- Updated all load_module directives in nginx configs
- Updated build checks in start scripts
- Updated branding in footer template
- Updated project name in all README files

The name 'sqlite-serve' better reflects the module's purpose:
serving dynamic content from SQLite databases via NGINX.
2025-11-15 15:11:44 -08:00

59 lines
1.8 KiB
Plaintext

# Book Catalog Configuration
# Demonstrates the sqlite-serve module with multiple locations and template inheritance
load_module target/debug/libsqlite_serve.dylib;
worker_processes 1;
events {}
error_log logs/error.log debug;
http {
# Global templates for shared components (header, footer, book_card partial)
sqlite_global_templates "server_root/global_templates";
server {
listen 8080;
root "server_root";
# Default redirect to all books
location = / {
return 301 /books/all;
}
# All books
location /books/all {
add_header "Content-Type" "text/html; charset=utf-8";
sqlite_db "book_catalog.db";
sqlite_query "SELECT * FROM books ORDER BY rating DESC, title";
sqlite_template "list.hbs";
}
# Programming books only
location /books/programming {
add_header "Content-Type" "text/html; charset=utf-8";
sqlite_db "book_catalog.db";
sqlite_query "SELECT * FROM books WHERE genre = 'Programming' ORDER BY rating DESC, title";
sqlite_template "list.hbs";
}
# Database books only
location /books/databases {
add_header "Content-Type" "text/html; charset=utf-8";
sqlite_db "book_catalog.db";
sqlite_query "SELECT * FROM books WHERE genre = 'Databases' ORDER BY rating DESC, title";
sqlite_template "list.hbs";
}
# Computer Science books only
location /books/computer-science {
add_header "Content-Type" "text/html; charset=utf-8";
sqlite_db "book_catalog.db";
sqlite_query "SELECT * FROM books WHERE genre = 'Computer Science' ORDER BY rating DESC, title";
sqlite_template "list.hbs";
}
}
}