Приветствую.
Пытаюсь поднять Django-приложение на Lighttpd + uwsgi. Но получаю проблему: статические и медиа-файлы возвращают 404. Вот часть выхлопа консоли веб-браузера:
Failed to load resource: the server responded with a status of 404 (Not Found) http://<мой ip>/static/css/base.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://<мой ip>/static/css/3party/highlight.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://<мой ip>/static/css/3party/jquery-ui.min.css
...
Failed to load resource: the server responded with a status of 404 (Not Found) http://<мой ip>/media/files/113d014b-8bf8-411d-8ba6-d7bd065f13f4.200x150.png
И далее всё в этом же духе.
Конфиг Lighttpd:
server.modules = (
"mod_access",
"mod_accesslog",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite",
"mod_scgi"
)
server.document-root = "/root/neboard/"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
include_shell "/root/lighttpd-1.4.45/doc/scripts/create-mime.conf.pl"
scgi.protocol = "uwsgi"
scgi.server = (
"/" => (( "host" => "127.0.0.1", "port" => 8080, "check-local" => "disable" )),
)
alias.url = (
"/static" => "/root/neboard/boards/static/",
"/media" => "/root/neboard/media/",
)
url.rewrite-once = (
"^(/static.*)$" => "$1",
"^(/media.*)$" => "$1",
)
Часть файла settings.py:
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = '/root/neboard/media/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = 'http://<мой ip>/media/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = '/root/neboard/boards/static/'
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = 'http://<мой ip>/static/'
[uwsgi]
module = neboard.wsgi:application
master = true
pidfile = /tmp/neboard.pid
socket = 127.0.0.1:8080
processes = 5
harakiri = 20
max-requests = 5000
disable-logging = true
vacuum = true
# socket=/var/run/neboard.sock
Заранее благодарю за помощь.