mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(server): no longer working subdir due to assets (fixes #2098)
This commit is contained in:
parent
68d094d119
commit
c18451a378
@ -133,7 +133,7 @@ export default class ExcalidrawTypeWidget extends TypeWidget {
|
|||||||
|
|
||||||
// currently required by excalidraw, in order to allows self-hosting fonts locally.
|
// currently required by excalidraw, in order to allows self-hosting fonts locally.
|
||||||
// this avoids making excalidraw load the fonts from an external CDN.
|
// this avoids making excalidraw load the fonts from an external CDN.
|
||||||
(window as any).EXCALIDRAW_ASSET_PATH = `${new URL(import.meta.url).origin}/node_modules/@excalidraw/excalidraw/dist/prod`;
|
(window as any).EXCALIDRAW_ASSET_PATH = `${window.location.pathname}/node_modules/@excalidraw/excalidraw/dist/prod`;
|
||||||
|
|
||||||
// temporary vars
|
// temporary vars
|
||||||
this.currentNoteId = "";
|
this.currentNoteId = "";
|
||||||
|
@ -102,7 +102,7 @@ export function buildConfig(): EditorConfig {
|
|||||||
allowedProtocols: ALLOWED_PROTOCOLS
|
allowedProtocols: ALLOWED_PROTOCOLS
|
||||||
},
|
},
|
||||||
emoji: {
|
emoji: {
|
||||||
definitionsUrl: new URL(import.meta.url).origin + emojiDefinitionsUrl
|
definitionsUrl: emojiDefinitionsUrl
|
||||||
},
|
},
|
||||||
syntaxHighlighting: {
|
syntaxHighlighting: {
|
||||||
loadHighlightJs: async () => {
|
loadHighlightJs: async () => {
|
||||||
|
@ -9,7 +9,7 @@ const assets = [ "assets", "stylesheets", "libraries", "fonts", "translations" ]
|
|||||||
export default defineConfig(() => ({
|
export default defineConfig(() => ({
|
||||||
root: __dirname,
|
root: __dirname,
|
||||||
cacheDir: '../../node_modules/.vite/apps/client',
|
cacheDir: '../../node_modules/.vite/apps/client',
|
||||||
base: "/" + asset_path,
|
base: process.env.NODE_ENV === "production" ? "" : asset_path,
|
||||||
server: {
|
server: {
|
||||||
port: 4200,
|
port: 4200,
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
|
16
apps/server/docker/nginx.conf
Normal file
16
apps/server/docker/nginx.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
server {
|
||||||
|
listen 8090;
|
||||||
|
|
||||||
|
location /trilium/ {
|
||||||
|
rewrite ^/trilium(/.*)$ $1 break;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
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;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_pass http://host.docker.internal:8082; # change it to a different port if non-default is used
|
||||||
|
proxy_cookie_path / /trilium/;
|
||||||
|
proxy_read_timeout 90;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user