interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / infra / nginx / snippets / aienos-forge.conf
| 1 | # /etc/nginx/snippets/aienos-forge.conf on hub and on the Spark front door - the old forge address |
| 2 | # https://www.aienos.com/forge/ redirects to INTERPLANE at https://interplane.io/ (one-site, 2026-11-10; |
| 3 | # it was a proxy to forged with X-Forge-Base /forge/, ForgeInfra 2026-11-07). |
| 4 | # Included inside the www.aienos.com server block of sites-enabled/aienos.com, after |
| 5 | # aienos-replicate.conf. `^~` keeps the site's `\.md$` and `\.om$` regex locations from taking |
| 6 | # forge paths such as .../blob/main/README.md. |
| 7 | # |
| 8 | # The /forge prefix is removed and the query string kept: |
| 9 | # /forge, /forge/, /forge?q -> https://interplane.io/explore[?q] (forged's home under /forge/ was |
| 10 | # the explore list; "/" on interplane.io is the static site) |
| 11 | # /forge/<path>[?q] -> https://interplane.io/<path>[?q] (every forged route: profiles, |
| 12 | # repos, archive/raw/release downloads, explore, search, stars, login, |
| 13 | # rad:<RID>) |
| 14 | # <path> is copied from $request_uri, so the client's percent-encoding is kept and nothing nginx |
| 15 | # decoded (no CR or LF) reaches the Location header. A request line that does not start with /forge/ |
| 16 | # (such as //forge/x, which nginx also routes here) goes to /explore. |
| 17 | # GET and HEAD get 301; every other method gets 308, so a POST stays a POST. |
| 18 | # A location with add_header drops the server's list, so the site's security headers are repeated. |
| 19 | # Nothing here reaches forged; conf.d/forge.conf stays for interplane.io. |
| 20 | |
| 21 | location = /forge { |
| 22 | add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; |
| 23 | add_header X-Content-Type-Options nosniff always; |
| 24 | add_header Referrer-Policy strict-origin-when-cross-origin always; |
| 25 | add_header X-Frame-Options DENY always; |
| 26 | add_header Content-Security-Policy "frame-ancestors 'none'" always; |
| 27 | if ($request_method !~ ^(GET|HEAD)$) { |
| 28 | return 308 https://interplane.io/explore$is_args$args; |
| 29 | } |
| 30 | return 301 https://interplane.io/explore$is_args$args; |
| 31 | } |
| 32 | |
| 33 | location ^~ /forge/ { |
| 34 | add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; |
| 35 | add_header X-Content-Type-Options nosniff always; |
| 36 | add_header Referrer-Policy strict-origin-when-cross-origin always; |
| 37 | add_header X-Frame-Options DENY always; |
| 38 | add_header Content-Security-Policy "frame-ancestors 'none'" always; |
| 39 | # A named capture is read back as a variable, copied as is. A numbered capture ($1) would be |
| 40 | # escaped a second time whenever the request had a %XX in it (%20 -> %2520), so it is not used. |
| 41 | set $aienos_forge_to /explore$is_args$args; |
| 42 | if ($request_uri ~ "^/forge/+(?<aienos_forge_path>[^?]+)") { |
| 43 | set $aienos_forge_to /$aienos_forge_path$is_args$args; |
| 44 | } |
| 45 | if ($request_method !~ ^(GET|HEAD)$) { |
| 46 | return 308 https://interplane.io$aienos_forge_to; |
| 47 | } |
| 48 | return 301 https://interplane.io$aienos_forge_to; |
| 49 | } |