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

How to disable static site generation and SEO metadata #10192

Closed
pfdgithub opened this issue Jun 3, 2024 · 1 comment
Closed

How to disable static site generation and SEO metadata #10192

pfdgithub opened this issue Jun 3, 2024 · 1 comment
Labels
closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way.

Comments

@pfdgithub
Copy link

In my case, I use the browser route, and docs.routeBasePath: "/" configuration.
The docs is deployed behind traefik and nginx multiple gateways, and the customer network is is a private network.

Traefik uses the stripprefix middleware to strip the xxx prefix.
Nginx uses the try_files $uri $uri/ /index.html directive to find files.
When the url path triggers the gateway fallback, it will respond with the incorrect redirect path.

# url with filename
browser (/xxx/category/index.html) -> traefik (/category/index.html) -> nginx(/category/index.html) -> nginx status 200 -> traefik -> browser

# url with trailing slash
browser (/xxx/category/) -> traefik(/category/) -> nginx(/category/) -> nginx status 200 (rewrite to `/category/index.html`) -> traefik -> browser

# url without trailing slash
browser (/xxx/category) -> traefik(/category) -> nginx(/category) -> nginx status 301 (redirect to `/category/`) -> traefik -> browser (/category/) -> traefik status 404 -> browser

Due to the /category directory exists, nginx attempts to redirect to that directory.
However, nginx is unaware of the xxx prefix, so it responds with the incorrect redirect to /category/.
If the /category directory doesn't exist, nginx can respond with the correct rewrite to /index.html.

# url without trailing slash (`/category` directory doesn't exist)
browser (/xxx/category) -> traefik(/category) -> nginx(/category) -> nginx status 200 (rewrite to `/index.html`) -> traefik -> browser

I can't modify the configurations of traefik and nginx, and trailingSlash: true is not a perfect solution, so I can only clean up redundant directories after building.
Is it possible to allow disabling the Static Site Generation (SSG) functionality, as well as useless SEO metadata under a private network, such as allowing url: "/"?

Originally posted by @pfdgithub in #3825 (comment)

@slorber
Copy link
Collaborator

slorber commented Jun 21, 2024

This is more a question than an issue, and should be a github comment instead

Also you posted the original content but did not clarify anything I asked for (cf my comment #3825 (comment)), which still makes things super hard to understand for me.

Remember Docusauurs is only responsible for building static files. Nginx/Traeffik is out of scope, and I don't know how these tools work.

You can disable SSG with the new v3.4 hash router.

Going to close for now because this is unactionable for me.

@slorber slorber closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
@slorber slorber added the closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way. label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: invalid This issue / PR is low quality, unwanted or spam and doesn't qualify as a contribution in any way.
Projects
None yet
Development

No branches or pull requests

2 participants