Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

2.8 KB
Raw Blame
server {
    listen 5173;
    server_name localhost;

    # The API logs its own requests; per-request lines and health probes from
    # nginx would interleave with them in the same container output.
    access_log off;

    # Allow larger OAuth/Better Auth session cookies in request headers.
    client_header_buffer_size 8k;
    large_client_header_buffers 4 32k;

    add_header X-Content-Type-Options "nosniff" always;
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "0" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    client_max_body_size 25m;

    gzip on;
    gzip_vary on;
    gzip_min_length 1000;
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_comp_level 6;

    location = /.well-known/oauth-protected-resource/api/mcp {
        proxy_pass http://127.0.0.1:1337/.well-known/oauth-protected-resource/api/mcp;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header CF-Connecting-IP "";
        proxy_set_header X-Kaneo-Client-IP "";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location = /.well-known/oauth-authorization-server/api {
        proxy_pass http://127.0.0.1:1337/.well-known/oauth-authorization-server/api;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header CF-Connecting-IP "";
        proxy_set_header X-Kaneo-Client-IP "";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /.well-known/ {
        return 404;
    }

    location /api/ {
        proxy_pass http://127.0.0.1:1337/api/;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header CF-Connecting-IP "";
        proxy_set_header X-Kaneo-Client-IP "";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # Defense in depth if a build leaves a source map in the static directory.
    location ~* \.map$ {
        return 404;
    }

    location / {
        root /var/lib/kaneo/html;
        index index.html;
        try_files $uri $uri/ /index.html;
    }
}