2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-17 12:33:08 +00:00
InvenTree/docs/docs/start/serving_files.md
Matthias Mair 005c8341bf
Improve devdocs (#4813)
* move devcontainer docs

* rename bare metal pages

* fix backlinks

* Add getting started for devs

* add mermaid

* include contrib in docs

* use another plugin

* include everything

* update doc checks

* fix install command

* remove mermaid

* remove inclusion tag

* remove empty list item

* readd include-markdown

* use non-conflicting syntax for include

* fix table rendering in mkdocs

* make controbuting embedable

* re-add mermaid

* remove empty section

* resturcture

* remove mermaid again
2023-06-09 10:16:30 +10:00

1.6 KiB

title
title
Serving Static and Media Files

Serving Files

In production, the InvenTree web server software does not provide hosting of static files, or user-uploaded (media) files.

When running in production mode (i.e. the INVENTREE_DEBUG flag is disabled), a separate web server is required for serving static and media files. In DEBUG mode, the django webserver facilitates delivery of static and media files, but this is explicitly not suitable for a production environment.

!!! into "Read More" You can find further information in the django documentation.

There are many different ways that a sysadmin might wish to handle this - and it depends on your particular installation requirements.

The docker production example provides an example using Nginx to serve static and media files, and redirecting other requests to the InvenTree web server itself.

You may use this as a jumping off point, or use an entirely different server setup.

Static Files

Static files can be served without any need for authentication. In fact, they must be accessible without authentication, otherwise the unauthenticated views (such as the login screen) will not function correctly.

Media Files

It is highly recommended that the media files are served in such a way that user authentication is required.

Refer to the docker production example for a demonstration of using nginx to serve media files only to authenticated users, and forward authentication requests to the InvenTree web server.