You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server {
listen 80;
server_name example.com;
root /path/to/your/files;
# Default location block
location / {
# Extract MIME type from the Accept header and map it to a file extension
set $file_ext "";
if ($http_accept ~* "text/html") {
set $file_ext "html";
}
if ($http_accept ~* "text/turtle") {
set $file_ext "ttl";
}
if ($http_accept ~* "application/json") {
set $file_ext "json";
}
# Try to serve a file with the determined extension or fall back to a 404
try_files $uri.$file_ext $uri $uri/ =404;
# Set the Content-Type header based on the Accept header
if ($file_ext = "html") {
add_header Content-Type "text/html";
}
if ($file_ext = "ttl") {
add_header Content-Type "text/turtle";
}
if ($file_ext = "json") {
add_header Content-Type "application/json";
}
}
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: