Repository navigation
Expand file tree
/
Copy pathnginx.container.conf
More file actions
86 lines (78 loc) · 3.96 KB
/
Copy pathnginx.container.conf
File metadata and controls
86 lines (78 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# One site: the static build of site/, served at the apex.
# The host nginx forwards the Host header; anything that is not an old host
# below (the apex, the health check's 127.0.0.1) gets the site.
# Until 2026-09-27 the docs lived on docs.reactmarkdownkit.com, each demo on
# its own subdomain, and www served a copy of the old home page. Each old
# host moves permanently to the apex, in one hop, so search engines carry
# each page's ranking over. A demo host had one page, `/`; it goes to the
# demo's path with its query (`?embed=1`, `?view=`), and the browser keeps
# the hash that carries a shared document. Keep these redirects for good.
map $host $rmk_moved_root {
docs.reactmarkdownkit.com /;
www.reactmarkdownkit.com /;
renderer.reactmarkdownkit.com /markdown-renderer;
editor.reactmarkdownkit.com /markdown-editor;
mermaid.reactmarkdownkit.com /mermaid-editor;
slides.reactmarkdownkit.com /markdown-slides;
}
# The two ownership files stay reachable on every old host without a
# redirect, so each old host stays verified in Google Search Console and Bing
# Webmaster Tools, which both need it verified to process the site move.
server {
listen 80;
server_name docs.reactmarkdownkit.com www.reactmarkdownkit.com
renderer.reactmarkdownkit.com editor.reactmarkdownkit.com
mermaid.reactmarkdownkit.com slides.reactmarkdownkit.com;
root /usr/share/nginx/html/site;
location = /googlec9e17fdcff1e9c06.html { try_files $uri =404; }
location = /BingSiteAuth.xml { try_files $uri =404; }
location = / {
return 301 https://reactmarkdownkit.com$rmk_moved_root$is_args$args;
}
# Any other path on an old host exists at the same path on the apex, or
# is a 404 there: the docs' pages, and the files every old host served
# (llms.txt, robots.txt, the mermaid badge).
location / {
return 301 https://reactmarkdownkit.com$request_uri;
}
}
server {
listen 80 default_server;
server_name _;
root /usr/share/nginx/html/site;
index index.html;
# Relative Location headers: this nginx only sees plain HTTP, and an
# absolute http:// redirect would add a hop through the host's TLS upgrade.
absolute_redirect off;
# The old home page served these at the apex root; the site keeps them under /img/.
location = /social-card.png { return 301 /img/social-card.png; }
location = /logo.svg { return 301 /img/logo.svg; }
location = /favicon.svg { return 301 /img/favicon.svg; }
# The renderer and editor overview pages merged into their demos (2026-09-27).
location ~ ^/react-markdown-renderer/?$ { return 301 /markdown-renderer$is_args$args; }
location ~ ^/react-markdown-editor/?$ { return 301 /markdown-editor$is_args$args; }
# The template plugin became the variables plugin (2026-09-27).
location ~ ^/markdown-template-engine/?$ { return 301 /markdown-variables$is_args$args; }
location ~ ^/docs/guides/markdown-template-variables/?$ { return 301 /docs/guides/markdown-variables$is_args$args; }
location ~ ^/docs/templates/?$ { return 301 /docs/variables/basics$is_args$args; }
location ~ ^/docs/templates/(basics|schemas|formatting|authoring)/?$ { return 301 /docs/variables/$1$is_args$args; }
# Vite fingerprints the bundles and the stylesheet under /assets/.
location /assets/ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
location = /index.html {
add_header Cache-Control "no-cache";
}
# Every route is a file: the build writes one index.html per route. An
# unknown path is a real 404, never the home page with a 200, which search
# engines index as a soft 404.
location / {
try_files $uri $uri/index.html $uri.html =404;
}
error_page 404 /404.html;
location = /404.html {
internal;
add_header Cache-Control "no-cache";
}
}