Commit d75f534d authored by Kristian Klausen's avatar Kristian Klausen 🎉 Committed by Jelle van der Waa
Browse files

archwiki: Simplify php blocks

parent a796434f
...@@ -69,4 +69,5 @@ $wgEditPageFrameOptions = "DENY"; ...@@ -69,4 +69,5 @@ $wgEditPageFrameOptions = "DENY";
## https://www.mediawiki.org/wiki/Manual:Short_URL ## https://www.mediawiki.org/wiki/Manual:Short_URL
$wgScriptPath = ""; $wgScriptPath = "";
$wgArticlePath = "/title/$1"; $wgArticlePath = "/title/$1";
$wgUsePathInfo = true; # $wgUsePathInfo is not necessary: https://github.com/wikimedia/mediawiki/blob/bb92c4d1acc029eed0f6848360dff5b2436695fc/includes/WebRequest.php#L151-L153
#$wgUsePathInfo = true;
...@@ -57,33 +57,13 @@ server { ...@@ -57,33 +57,13 @@ server {
return 307 /title/$1; return 307 /title/$1;
} }
# special case due to our '/index.php/Main_Page' type URLs
location ~ ^/(?:index|redirect)\.php(?:/.*)$ {
access_log /var/log/nginx/{{ archwiki_domain }}/access.log main;
access_log /var/log/nginx/{{ archwiki_domain }}/access.log.json json_main;
fastcgi_pass archwiki;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
include fastcgi_params;
}
# special case for '/load.php' type URLs to cache css/js in nginx to relieve php-fpm # special case for '/load.php' type URLs to cache css/js in nginx to relieve php-fpm
location = /load.php { location = /load.php {
access_log /var/log/nginx/{{ archwiki_domain }}/access.log main; access_log /var/log/nginx/{{ archwiki_domain }}/access.log main;
access_log /var/log/nginx/{{ archwiki_domain }}/access.log.json json_main; access_log /var/log/nginx/{{ archwiki_domain }}/access.log.json json_main;
fastcgi_pass archwiki; fastcgi_pass archwiki;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$; include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS on;
include fastcgi_params;
fastcgi_cache wiki; fastcgi_cache wiki;
fastcgi_cache_valid 200 10m; fastcgi_cache_valid 200 10m;
...@@ -98,16 +78,12 @@ server { ...@@ -98,16 +78,12 @@ server {
# normal PHP FastCGI handler # normal PHP FastCGI handler
location ~ ^/[^/]+\.php$ { location ~ ^/[^/]+\.php$ {
try_files $uri =404;
access_log /var/log/nginx/{{ archwiki_domain }}/access.log main; access_log /var/log/nginx/{{ archwiki_domain }}/access.log main;
access_log /var/log/nginx/{{ archwiki_domain }}/access.log.json json_main; access_log /var/log/nginx/{{ archwiki_domain }}/access.log.json json_main;
fastcgi_pass archwiki; fastcgi_pass archwiki;
fastcgi_index index.php; fastcgi_index index.php;
if (!-f $document_root$fastcgi_script_name) { include fastcgi.conf;
return 404;
}
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS on;
include fastcgi_params;
} }
# whitelist known OK directories # whitelist known OK directories
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment