requarks / wiki-v1

Legacy version (1.x) of Wiki.js
https://wiki.js.org
GNU Affero General Public License v3.0
101 stars 75 forks source link

Reverse Proxy Domain does not work on Synology NAS #165

Closed gojennie closed 5 years ago

gojennie commented 5 years ago

Hello! This is a help request. I can't seem to get my domain to point to the right place. Any insight would be truly valued~

Problem: When I type my domain in to my browser, the connection hangs. I get this error : ERR_CONNECTION_TIMED_OUT

I am running the Wiki.js V1 and mongodb in a container using docker. They are being hosted on my Synology NAS at home (unfortunately I can't test this at home at the moment). Both containers seem to be working:

Log of Wiki: image

Log of DB: image

This is the Reverse Proxy Rules: image

For your reference, here is the docker-compose.yml file:

image

And here is the config.yml:

image

Where did I go wrong? @NGPixel Please help when you get a chance thank you!

NGPixel commented 5 years ago

Try running mongoDB as a separate container. Then run wiki.js. In some instances, the mongo container isn't ready to serve requests by the time wiki.js is booting.

gojennie commented 5 years ago

Hi, thank you for replying. I'm puling my hair out at this point. MongoDB is running in a separate container from the start.. It's really strange, now I see the favicon showing up on the corner. And an 502 error.

image

image

I'm new to this porting rule so I'm not sure if I understand this correctly. Please help me check my logic.

  1. Browser - I type wiki.mydomain.ca:8888
  2. Router - Router port 8888 is port forwarded to local port 8888
  3. Synology Reverse Proxy (built in NGINX) - Reverse proxy sends wiki.mydomain.ca:8888 to container port 3003
  4. Docker-compose.yml - Wikijs port is set to 3000:3003 (3000 is host, 3003 is container)
  5. Config.yml - Main server port is 3000.
gojennie commented 5 years ago

I finally got it working. It was an issue with reverse proxy and firewall. I hope no one spends as much time as I did so I'll post my solution in case anyone runs into the same troubles.

config.yml:

image

Note: Ensure that the host is the public domain you will enter to visit the website. This must match otherwise your gonna get an ugly wiki without any CSS.

docker-compose.yml: image

Reverse Proxy (inside Synology NAS):

  1. Go to Control Panel
  2. Application Portal
  3. Reverse Proxy Rules Note: Destination should be HTTP not HTTPS! image

Disable firewall (inside Synology NAS):

  1. Control Panel
  2. Security
  3. Uncheck 'Enable firewall' Note: It is good practice to enable firewall. Find out which ports you want to keep and add it to the rules (Edit Rules). Then disable all unused ports for security measure.

Router Configuration (inside Synology NAS):

  1. Control Panel
  2. External Access
  3. Router Configuration
  4. Press Create
  5. Set custom Local port 8888 and Router port 8888 Note: Local port 8888 needs access to internet so you must forward to Router port 8888

My understanding corrected from previous post:

  1. Browser - I type wiki.mydomain.ca:8888
  2. Router - Router port 8888 is port forwarded to local port 8888
  3. Synology Reverse Proxy (built in NGINX) - Reverse proxy sends wiki.mydomain.ca:8888 to HOST port 5005
  4. Docker-compose.yml - Wikijs port is set to 5005:5005 (5005 is host, 5005 is container)
  5. Config.yml - Main server HOST port is 5005.

I'm so thrilled that it's working after 7 days of hard work... Now I'm going to try installing beta and see which I like better 😄