bookwyrm_ynh/conf/nginx.conf
2024-01-19 13:44:52 +01:00

30 lines
772 B
Nginx Configuration File

#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
proxy_pass http://127.0.0.1:__PORT__/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
# directly serve images and static files from the
# bookwyrm filesystem using sendfile.
# make the logs quieter by not reporting these requests
location ~ \.(bmp|ico|jpg|jpeg|png|tif|tiff|webp|css|js)$ {
root __INSTALL_DIR__;
try_files $uri =404;
more_set_headers "X-Cache-Status: STATIC";
access_log off;
}
# block access to any non-image files from images or static
location ~ ^/images/ {
return 403;
}
location /images/ {
alias __INSTALL_DIR__/images/;
}
location /static/ {
alias __INSTALL_DIR__/static/;
}