43 lines
1.4 KiB
Plaintext
43 lines
1.4 KiB
Plaintext
# URL Shortener — dedicated subdomain location blocks
|
|
# Use inside the server {} block for a host such as s.example.com. Configure
|
|
# base_url = "https://s.example.com" in config.toml.
|
|
|
|
# Preserve the no-store policy for the HTML entry point.
|
|
location = / {
|
|
proxy_pass http://127.0.0.1:18082;
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_hide_header Cache-Control;
|
|
add_header Cache-Control "no-store";
|
|
}
|
|
|
|
# Preserve the revalidation policy for CSS, JavaScript, and fonts.
|
|
location ^~ /static/ {
|
|
proxy_pass http://127.0.0.1:18082;
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_hide_header Cache-Control;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
# API calls and short-code redirects.
|
|
location / {
|
|
proxy_pass http://127.0.0.1:18082;
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|