Fix borked header (add_header requires default_type to be set apparenlty?)

This commit is contained in:
askiiart 2023-12-06 09:20:34 -06:00
parent c5c0140c29
commit fbd05a21af
Signed by untrusted user who does not match committer: askiiart
GPG key ID: BC3800E55FB54D67

View file

@ -3,6 +3,7 @@ server {
listen 80;
listen [::]:80;
server_name localhost;
default_type text/html;
#access_log /var/log/nginx/host.access.log main;
@ -69,11 +70,12 @@ server {
}
location /ip {
default_type text/plain;
return 200 "$remote_addr";
}
location /ip/json {
add_header Content-Type "application/json";
default_type application/json;
return 200 '{"ip":"$remote_addr"}';
}
@ -112,8 +114,9 @@ server {
location /.git {
# There is no standard way to present options, but in the rare cases that 300 is used it just has a list of links. The Location header is for preferred thing.
default_type "text/html";
add_header Location "https://git.askiiart.net/askiiart/askiiart-net";
return 300 '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body><a href="https://git.askiiart.net/askiiart/askiiart-net">Self-hosted</a><br><a href="https://github.com/askiiart/askiiart-net">GitHub</a></body></html>';
return 200 '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body><a href="https://git.askiiart.net/askiiart/askiiart-net">Self-hosted</a><br><a href="https://github.com/askiiart/askiiart-net">GitHub</a></body></html>';
}
error_page 300 /error/300.html;