Skip to content

Deploying on vps #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
liulex opened this issue Dec 1, 2016 · 4 comments
Closed

Deploying on vps #18

liulex opened this issue Dec 1, 2016 · 4 comments
Labels

Comments

@liulex
Copy link
Contributor

liulex commented Dec 1, 2016

Hi, as discussed in #7 , it's not SEO friendly to always return 404. From my understanding, it's due to the way github hosts the contents. Since I can also deploy the documention on my vps, I suppose there should be ways to avoid returning 404, is that right? If so, could you offer some instructions about it? Thanks!

@QingWei-Li
Copy link
Member

QingWei-Li commented Dec 1, 2016

You only need to proxy all route to index.html, exclude the markdown file. Such as nginx

server {
    listen 80;
    server_name xxx.com;

    location ~ \.md$ {
        break;
    }

    location / {
        rewrite / /index.html;
        break;
    }
}

@liulex
Copy link
Contributor Author

liulex commented Dec 1, 2016

Thanks for your instructions! It helped a lot.

It works well for the pages in /docs/, but not for those in /docs/zh-cn/.
When /zh-cn is visited, docsify will try to use '/zh-cn.md'...

Adding one more location match can fix it:

location = /zh-cn {
	rewrite / /zh-cn/ permanent;
}

But this way a '/' will be appended to the url.
i.e. when I visit https://docs.snipaste.com/zh-cn, the url will be changed to https://docs.snipaste.com/zh-cn/.
Though it's no big deal, is there any way to fix this?

@QingWei-Li
Copy link
Member

It is right. You need visited '/zh-cn/'.

@liulex
Copy link
Contributor Author

liulex commented Dec 2, 2016

OK. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants