Hi,
I am trying to run wiki.js and apache on the same server, similar to this approach: http://stackoverflow.com/questions/9831594/apache-and-node-js-on-the-same-server
This kind of works, but now wiki.js is searching for all the assets on the root level (e.g. mydomain.com/css) instead of the level of the wiki (e.g. mydomain.com/mywiki/css)
Do you have a suggestion on how to fix this? Or can you recommend another way of running wiki.js and other apache services on the same server?
Thanks,
Benedikt
The issue is not running wiki.js and apache on the same server. This is done easily and the link you provided is correct. Wiki.js was simply not designed to run inside a subfolder, at least not right now.
I would suggest using a subdomain (e.g. wiki.yourdomain.com). The rest of the setup is the same (using ProxyPass in Apache).
Is there any reason you must use a subfolder instead of a subdomain/domain?
Nick
Thanks for your answer. I currently have no (or very little) control over the DNS entries for the domain, so subdomain is not a solution at the moment. But I realized that I can just use mydomain.com:port for now. Maybe not the most beautiful solution, but it works.
Benedikt
@NGPixel what kind of work would need to happen to enable running in a subdirectory? I would much prefer this over using a subdomain or port. Happy to do the work and submit a PR if you can push me in the right direction here.
@rubberduck203 I think you can put wiki.js anywhere you want. If you would like the URL seems like domain.com/subdirectory you need a web server such as nginx and a suitable rewrite nginx rule.
The app uses a number of absolute paths. This makes proxying something like
domain.com:3001/
To
domain.com/wiki
nigh impossible. I've dealt with this kind of thing before, and while it might appear to work at first, you'll quickly find broken links.
The installation wizard explicitly states that Wiki.Js doesn't support this. I'm just trying to get a feel for what kind of work it would take to get it there.
The next beta will have support for sub-directories.
Sweet. I'll be looking forward to this and the history viewer.
If there's anything I can do to help, feel free to ping me @NGPixel
Is the next beta out yet?
The current stable release has basic support for subdirectories.
2.0 will introduces full support.
How do you specify the subdirectory?
I've been trying
host: "https://my.domain.com/wikijs"
But I get immediately redirected to https://my.domain.com/login instead of https://my.domain.com/wikijs/login
This is using the "requarks/wiki:latest" Docker image. I haven't been able to find out which exact version that is.
You must use a reverse proxy such as nginx to use subdirectories.
That's exactly what I'm doing. Nginx on the host OS and wikijs under docker-compose.
The problem is, when I open "https://my.domain.com/wikijs" in the browser, Wikijs seems to redirect to "/login", which ends up being https://my.domain.com/login
Hey I have the same problem, this is not really working yet...
Otherwise please provide an example for nginx,
(I also see that it is working on a subdir for the docs of the wiki...)
I am using location ^~ /wiki { and it is not working, what could be the solution?
What is used in the documentation config?
Hello,
Today I also wasted to much time to get the wiki.js running behind nginx.
it redirects instantly to https://domain.ex/login instead of https://domai.ex/wiki/login.
the problem is, that there is no prefix in the configuration.
But on the other side https://docs.requarks.io/wiki works as i expected?
Can you explain / give any hind why it works for you?
thank you
There's only partial support for a subfolder installation. (e.g. /login doesn't work)
Full support is coming in 2.0.
The docs website isn't using a subfolder: https://docs.requarks.io/
Hello,
I am trying to setup wiki.js and just wondering what I have to do to get the wiki.js homepage to show on the root domain. Do I need apache to set this up or is node supposed to take care of this?
@hashguide
Please refer to the Doc https://docs.requarks.io/wiki/admin-guide/setup-nginx
In the reverse-proxy example, nginx is proxied to local port 3001.
Therefore, when you install wiki.js, you should config wiki.js listen to http://localhost:3001
After further consideration, running Wiki.js in a subfolder path will not be supported in 2.0. It adds too much complexity to various components. If a domain / sub-domain is not an option for you, a reverse-proxy could address this issue, but no support will be provided for this.
I鈥檓 sorry, but I鈥檓 confused. The problem is that a reverse proxy won鈥檛 work because there are absolute paths instead of relative ones.
@rubberduck203 There are no absolute paths in 2.0.
Ahh. Okay. Perfect!
not understand how complex to support sub-directory, hope will support this feature
I'm setting up a wiki for the corporation I work for, and I was really hoping to use this, but this issue is preventing that. I get there are deadlines and priorities for everything, but this is a huge limitation, and it would have been very nice to see this as a higher priority issue.
Any thoughts on including relative paths that allow for subdomains in the near future?
@gunnarleffler Subdomains have always been supported...
My apologies, it was late when I wrote that. What I meant to write was: It would be nice to have relative path functionality such that wiki.js can run under a sub directory. e.g. subdomain.corporate.intranet/wiki
For various reasons in my situation, setting up subdomains like wiki.subdomain.corporate.intranet are less than optimal. I'd like to set up a wiki per project as a sub-domain.
Other wikis do this, however I'd like to start using a wiki built with a more modern tech stack like wiki.js =)
I think there are many others in a similar situation, and might go along way to increasing user share. I'd be willing to pitch in if need be.
@gunnarleffler You'd still need to setup a reverse-proxy to achieve that. Other wikis are mostly PHP which makes them really easy to run within a subfolder. Node.js apps don't run in folders or within the scope of a webserver. They are standalone apps.
At the moment, there're no plan to allow subfolder installations. They are a real pain to support in Node.js. A dedicated hostname is the way to go.
From my experience it's fairly straightforward to get a node.js app to run under a reverse proxied subfolder.
Thanks for your time. Cool project BTW.
@gunnarleffler How did you config your reverse proxy?
I tried this in nginx but some static resource not point to subfolder
@NGPixel Can we change webpack config publicPath as publicPath: '/wiki', to archive this?
I just want to try it but got build failed.
Disappointed that this isn't able to be put in a subdirectory.
Disappointed that this isn't able to be put in a subdirectory.
This same problem, with software-generated literal IPv4 addresses, was a hindrance to web deployment on IPv6. There are solutions, but they may not be as simple as one may wish.
Sorry for updating this thread, but is the official stance that subdirectory support is NOT supported and not possible with reverse proxy and that the only supported scenario is a dedicated subdomain?
@justinacolmena See #1417 for the actual technical reasons.
@vincent-polite Correct. You need a subdomain.
For us the main use case for using a subdomain is as the use of the wiki in a corporate network where http://intranet/docs would show documentation about the intranet. "Intranet" being the hostname of the server. (NOTE we have no control on the DNS server at the moment to create subdomains for local machines)
For us the main use case for using a subdomain is as the use of the wiki in a corporate network where http://intranet/docs would show documentation about the intranet. "Intranet" being the hostname of the server. (NOTE we have no control on the DNS server at the moment to create subdomains for local machines)
you are in control of your corporate network right? Why not spawning a DNS server inside your network? Also many router supports custom hosts if you use router as a DNS.
This is a dealbreaker for us too as we are unable to get subdomain. Tried using wikijs with a subfolder today with ngnix reverse-proxy and was lucky to find this thread so I was able to give up the idea of using wikijs fast without wasting any time.
Today I deploy wiki.js on kubernetes, I am using ingress-nginx,
and set path: /wiki does not work.
And I can't find solution.
@Hokwang thats because it鈥檚 unsupported. The maintainer has made it clear he鈥檚 either unwilling or unable to fix the code, or willing to accept any help fixing it.
You can use a subdomain instead of a path, if that鈥檚 an option for you.
Most helpful comment
I'm setting up a wiki for the corporation I work for, and I was really hoping to use this, but this issue is preventing that. I get there are deadlines and priorities for everything, but this is a huge limitation, and it would have been very nice to see this as a higher priority issue.