This commit is contained in:
Mateusz Gruszczyński committed 2026-10-26 09:30:10 +01:00
1 parent b85201889e
commit b035648b81
21 files changed
+318 -73

No files matched your search

+6 -22
View File
@@ -1,29 +1,13 @@
# Set FILES_PUBLIC_URL=files.note.example.com in RustPad.
# RustPad listens on FILES_PORT=3001 with attachment routes only.
server {
listen 443 ssl;
server_name files.note.example.com;
location ^~ /f/ {
proxy_pass http://rustpad:3000;
# Add your ssl_certificate and ssl_certificate_key configuration here.
location / {
proxy_pass http://rustpad:3001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Cookie "";
proxy_set_header Authorization "";
proxy_hide_header Set-Cookie;
proxy_intercept_errors on;
error_page 404 = @file_not_found;
}
location @file_not_found {
internal;
default_type text/plain;
return 404 "Not Found\n";
}
location / {
default_type text/plain;
return 404 "Not Found\n";
}
}
}
+15 -20
View File
@@ -1,26 +1,21 @@
frontend http_front
# Merge with your existing TLS frontend; route by hostname, not URL path.
# Set FILES_PUBLIC_URL=files.note.example.com in RustPad.
# The example assumes the main site shares the same 443 frontend.
frontend https_front
bind *:443 ssl crt /etc/haproxy/certs/example.pem
mode http
acl files_host hdr(host) -i files.note.example.com
use_backend rustpad_files if files_host
default_backend rustpad_app
acl rustpad_path path_beg /f/
use_backend rustpad_backend if rustpad_path
http-request return status 404 \
content-type "text/plain" \
string "Not Found" unless rustpad_path
backend rustpad_backend
backend rustpad_files
mode http
option httpchk GET /health
http-check expect status 200
http-request set-header X-Forwarded-Proto https
http-request del-header Cookie
http-request del-header Authorization
server rustpad-files rustpad:3001 check
http-response del-header Set-Cookie
http-response return status 404 \
content-type "text/plain" \
string "Not Found" if { status 404 }
server rustpad rustpad:3000 check
backend rustpad_app
mode http
http-request set-header X-Forwarded-Proto https
server rustpad-app rustpad:3000 check