Closed ohmykreee closed 1 year ago
In your custom static templates, revert everything to the default value, and try adding this tag right after the <title>...</title>
tag.
<base href="{{ .Config.RootURL }}">
Thank you for your suggestion.
I have reverted to the default value and added the <base>
tag as you recommended. Here's a partial snippet of my template/base.html
file to show the changes I made:
{{ define "header" }}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ if .Data.Title }} {{ .Data.Title }} - Niltalk {{ else }}Niltalk — Instant disposable chat rooms{{ end }}</title>
<base href="{{ .Config.RootURL }}">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
...
However, I'm still encountering the same error when using custom static files to launch the application. Here are some screenshots of the errors I received in my browser:
Please let me know if there's anything else I could try. Thank you for your assistance.
Ah, my bad. This would require the handlers that are registered in Go program to also be aware of the sub-path, which isn't possible out of the box.
You could look at Nginx rewrite rules to strip the subpaths before proxying the requests to the backend.
I am attempting to deploy the Niltalk application on a subdirectory as a micro service, but I am encountering several issues.
Specifically, I have set the
root_url
in theconfig.toml
file tohttps://example.site/chat
, and I have set up a reverse proxy in Nginx to point to the application:When I access
https://example.site/chat
, my browser is reporting multiple errors related to missing resources:I tried using use custom static files and modify some files like
template/base.html
to reference them, but this approach only made things worse:Is there a way to host Niltalk in a subdirectory as a microservice?