hffqyd / tw5-server

A protable local server for TiddlyWiki5 that saves and backups wiki.
GNU General Public License v3.0
25 stars 4 forks source link

Hosting on nginx webserver #1

Closed Qwerty-Space closed 1 year ago

Qwerty-Space commented 1 year ago

Hello,

I've tried hosting this on nginx with the config:

location /wiki {
  proxy_pass http://127.0.0.1:10123/;
}

I used the command tw5server -p10123 to run the tw5 server, but I get 502 bad gateway. In my nginx logs I see:

2023/06/01 20:42:38 [error] 19183#19183: *149 connect() failed (111: Connection refused) while connecting to upstream, client: 192.redacted.server.ip, server: redacted.url, request: " GET /wiki HTTP/1.0", upstream: "http://127.0.0.1:10123/", host: "redacted.url"

Do you have any idea why this might be?

hffqyd commented 1 year ago

First, "502 bad gateway" suggests tw5server might not start successfully, as there should be a colon : between -p and port number: tw5server -p:10123.

Second, using tw5server through proxy haven't been considered in previous version, but I have just updated it, which had been tested to work well through Nginx proxy using config like below (add a / to the location path tail).

Please download the new version to have a try.

location /wiki/ {
  proxy_pass http://127.0.0.1:10123/;
}
Qwerty-Space commented 1 year ago

Hey, I've discovered that it wasn't an issue with nginx or tw5server, but it's an issue with my hosting provider.