deploy docsify with nginx proxy
Bug Report
How can I get docsify to use a different path to map so it looks like it's on the deploy and root paths? or How to deploy docsify locally with nginx proxy mapping?
Steps to reproduce
nginx config
server {
listen 8888;
server_name 127.0.0.1;
location / {
root D:/APP/nginx-1.21.1/docsify;
index index.html;
}
}
proxy config
server {
listen 55500;
server_name 127.0.0.1;
location /docsify/ {
proxy_pass http://127.0.0.1:8888/;
}
}
What is current behaviour
It will seens normal at 127.0.0.1:8888, but it show error code 404 when opening 127.0.0.1:55500/docsify/ . I tried configuring basepath and alias coverpage and and it didn't work, and if I try to specify the location of the README.md file in nginx, it doesn't work either . It seems that only the md file cannot be loaded normally
What is the expected behaviour
i want to seem same behavior at 127.0.0.1:8888 at 127.0.0.1:55500/docsify/
Other relevant information
-
[ ] Bug does still occur when all/other plugins are disabled?
-
Your OS: windows10
-
Node.js version: 14.17.1
-
npm/yarn version: 6.14.13
-
Browser version: Google ver 102
-
Docsify version: 4.12.2
-
Docsify plugins: search.min.js docsify-copy-code.min.js docsify-sidebar-collapse.min.js
Please create a reproducible sandbox
Mention the docsify version in which this bug was not present (if any)
try edit your proxy config like this
server {
listen 55500;
server_name 127.0.0.1;
location /docsify/ {
proxy_pass http://127.0.0.1:8888/;
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;
}
}
Here is the Nginx doc: https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass
2022-05-31 to 2025-06-16, I think this issue has already been resolved.