kitsu-docker
kitsu-docker copied to clipboard
custom nginx container doesn't work well with kitsu
Here's my custom nginx server running in another Docker container:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
}
http {
server {
listen 80;
server_name localhost 127.0.0.1;
error_page 404 = @foobar;
location @foobar {
return 301 /; # 301 (redirect) if not found
}
# Declare proxies:
location /api/ {
proxy_pass http://<host-url>:5000/api/;
}
location /kitsu/ {
sub_filter 'src=/css/' 'src=/kitsu/css/';
sub_filter 'src=/js/' 'src=/kitsu/js/';
sub_filter_once off;
proxy_pass http://<host-url>:5000/;
}
# Use Access-Control-Allow-Origin header to allow pre-flight request checks
location ~* \.(eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
}
}
All the Kitsu css/js files somehow ended up in /css/ and /js/ directories instead of /kitsu/css/ and /kitsu/js/ directories, which causes 404 whenever I connect to Kitsu.