-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Add deployment guide for NGINX #10872
Comments
Hi Honestly I'd prefer to not add this guide to our official docs, and would prefer if it was an external resource we simply link to. The reason is: I don't have the skills to maintain it. Introducing it means that it's now my responsibility to ensure this "official" guide remains up to date over time and for all the upcoming versions of Nginx. There's an infinite number of ways to host static websites, using various software. We can't document them all officially: we count on our community for that. |
The important things to host a website built by Docusaurus by Nginx/Apache are:
I think the former is stable, and the latter can be shared with Apache. |
The latter:
I think an official guideline for them would be appreciated. |
I would also appreciate official guide to caching in nginx mentioned by @tats-u , it would be immensely helpful. my hypothesis here is this, feedback welcome, so that we can arrive at idiomatic configuration in nginx for file server {
listen 80;
index index.html;
root /var/www/html;
location ~* \.html$ {
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0" always;
}
# /static/ directory - medium-term caching
location /static/ {
expires 4w;
add_header Cache-Control "public, max-age=2419200";
try_files $uri =404;
}
# All other static assets - long-term caching
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?|ttf|eot|webp)$ {
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
location / {
try_files $uri $uri/index.html $uri/ =404;
}
}
|
Have you read the Contributing Guidelines on issues?
Description
Hey all, feel like we could enhance the Deployment docs by providing a quick getting started guide on hosting docusaurus static build files via a dockerised NGINX. Would be willing to write a quick guide!
Self-service
The text was updated successfully, but these errors were encountered: