nixos/mediawiki: fix rewrites for static ressources and rest API
This commit is contained in:
parent
b645bf2f1b
commit
915ad8a77b
@ -552,24 +552,20 @@ in
|
||||
deny all;
|
||||
'';
|
||||
# MediaWiki assets (usually images)
|
||||
"~ ^/w/resources/(assets|lib|src)" = {
|
||||
tryFiles = "$uri =404";
|
||||
extraConfig = ''
|
||||
add_header Cache-Control "public";
|
||||
expires 7d;
|
||||
'';
|
||||
};
|
||||
"~ ^/w/resources/(assets|lib|src)".extraConfig = ''
|
||||
rewrite ^/w(/.*) $1 break;
|
||||
add_header Cache-Control "public";
|
||||
expires 7d;
|
||||
'';
|
||||
# Assets, scripts and styles from skins and extensions
|
||||
"~ ^/w/(skins|extensions)/.+\\.(css|js|gif|jpg|jpeg|png|svg|wasm|ttf|woff|woff2)$" = {
|
||||
tryFiles = "$uri =404";
|
||||
extraConfig = ''
|
||||
add_header Cache-Control "public";
|
||||
expires 7d;
|
||||
'';
|
||||
};
|
||||
"~ ^/w/(skins|extensions)/.+\\.(css|js|gif|jpg|jpeg|png|svg|wasm|ttf|woff|woff2)$".extraConfig = ''
|
||||
rewrite ^/w(/.*) $1 break;
|
||||
add_header Cache-Control "public";
|
||||
expires 7d;
|
||||
'';
|
||||
|
||||
# Handling for Mediawiki REST API, see [[mw:API:REST_API]]
|
||||
"/w/rest.php".tryFiles = "$uri $uri/ /rest.php?$query_string";
|
||||
"/w/rest.php/".tryFiles = "$uri $uri/ /w/rest.php?$query_string";
|
||||
|
||||
# Handling for the article path (pretty URLs)
|
||||
"/wiki/".extraConfig = ''
|
||||
|
Loading…
Reference in New Issue
Block a user