Skip to content
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

Problem with mkdocs serve in remote host #1239

Closed
beeva-marcosromero opened this issue Jun 9, 2017 · 4 comments
Closed

Problem with mkdocs serve in remote host #1239

beeva-marcosromero opened this issue Jun 9, 2017 · 4 comments

Comments

@beeva-marcosromero
Copy link

Hi,
I need configure a mkdocs in a instance locate in Amazon Web Services. This instance will be access through one nginx.
All the configuration of the instance is good (Security groups, VPC, subnets, ports, etc).
When I launch the command "mkdocs serve" in my local with material theme previous install, the execution is perfect. I can watch the documents perfectly, however when
I launch the comand "mkdocs serve -a IP_INSTANCE:8000" for some reason, I can watch the documents correctly... the theme is missing or don't show.

These things are perfectly configured:

  • VPC, subnet, security groups from AWS instance. The instance has a private IP.
  • ubuntu 16.04
  • mkdocs version 0.16.3
  • python version 2.7.12
  • python packages installed

I need to access to this service through a URL like https://my_url.com/documentation
So this is the problem... If I put the context "/documentation" when I launch mkdocs serve I can't watch anything, however, if I put
all the documents inside a directory called "documentation" I can watch the documents, but not the theme... It paint very bad...
Neither I can't find documents...

In summary, I need something like this http://www.mkdocs.org/

Please, someone can help me?

Thanks.

@waylan
Copy link
Member

waylan commented Jun 9, 2017

Please be aware that the serve command is only intended for local development and was never intended to serve a live site. I doubt it can handle concurrent connections, which is likely the cause of your problem. The serve command is only intended to be used while authoring your docs on a local machine to verify your edits, etc. Under no circumstances should you ever try to proxy a connection to the dev server.

MkDocs is a static site generator. Its intended use case is to generate static files which are deployed by being uploaded to a static file server. You could use AWS' static file server (see their docs), or if you already have an nginx instance running, you could point it at a directory of static files (see those docs). In either case, run mkdocs build and then copy the contents of the site directory to the appropriate location on your server. That is the only type of deployment we support. Any other type of deployment is out of scope for MkDcos, and not something we can help with.

We do document how to deploy to a few specific services, but even those are all static file serves which are essentially doing what I describe above. As you can see. the Other Providers section details what I summarized above in a more general case.

@waylan waylan closed this as completed Oct 31, 2017
@nonplus
Copy link

nonplus commented Dec 29, 2017

I've run into a (possibly) related problem when running mkdocs serve inside a Docker container. I wasn't getting any response data on the published host port (using curl http://localhost inside the container worked).

My fix was to tell mkdocs to listen on all IP addresses, e.g. mkdocs serve -a 0.0.0.0:8000. This may solve your problem when running behind nginx in AWS.

@darkn3rd
Copy link

Thank you. I wanted to support local development by running this in a container, so this helped. Replies that you are using it wrong were not as helpful.

@midacts
Copy link

midacts commented Mar 1, 2020

@nonplus a few hours and 2 docker for desktop installs later and I find your post.

I salute you, good sir.

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

No branches or pull requests

5 participants