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;
|
deny all;
|
||||||
'';
|
'';
|
||||||
# MediaWiki assets (usually images)
|
# MediaWiki assets (usually images)
|
||||||
"~ ^/w/resources/(assets|lib|src)" = {
|
"~ ^/w/resources/(assets|lib|src)".extraConfig = ''
|
||||||
tryFiles = "$uri =404";
|
rewrite ^/w(/.*) $1 break;
|
||||||
extraConfig = ''
|
add_header Cache-Control "public";
|
||||||
add_header Cache-Control "public";
|
expires 7d;
|
||||||
expires 7d;
|
'';
|
||||||
'';
|
|
||||||
};
|
|
||||||
# Assets, scripts and styles from skins and extensions
|
# Assets, scripts and styles from skins and extensions
|
||||||
"~ ^/w/(skins|extensions)/.+\\.(css|js|gif|jpg|jpeg|png|svg|wasm|ttf|woff|woff2)$" = {
|
"~ ^/w/(skins|extensions)/.+\\.(css|js|gif|jpg|jpeg|png|svg|wasm|ttf|woff|woff2)$".extraConfig = ''
|
||||||
tryFiles = "$uri =404";
|
rewrite ^/w(/.*) $1 break;
|
||||||
extraConfig = ''
|
add_header Cache-Control "public";
|
||||||
add_header Cache-Control "public";
|
expires 7d;
|
||||||
expires 7d;
|
'';
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Handling for Mediawiki REST API, see [[mw:API:REST_API]]
|
# 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)
|
# Handling for the article path (pretty URLs)
|
||||||
"/wiki/".extraConfig = ''
|
"/wiki/".extraConfig = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user