You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: "/"?
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
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
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 thexxx
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.
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
.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)
The text was updated successfully, but these errors were encountered: