Jump to content

Recommended Posts

Posted (edited)

Hello,

I have installed MediaWiki at my website: https://salt.helioho.st/saltwiki/

I would like to point another subdomain (salt.wiki.gd) to this wiki and have the Short URL work as salt.wiki.gd/Article_Path

MediaWiki recommends using this tool to set up Short URLs but it requires changing the nginx.conf file, which I have gathered requires root access. Is it possible to have this changed by root admins?

Also, to point salt.wiki.gd to my wiki, do I need to request it to be added as a domain?

Thank you

Edited by lia
Posted

Please disregard the last question, I have done some research and realized this would be a parked/alias request.

Posted (edited)

My apologies, I realize I did not provide sufficient details.

The Short URL builder asks for the following credentials to generate the code for nginx.conf:

fastcgi_pass
fastcgi_params

This is the nginx.conf code it would generate:

server {
	# [...]

	# Location for the wiki's root
	location /saltwiki/ {
		try_files $uri $uri/ @mediawiki;
		
		# Do this inside of a location so it can be negated
		location ~ \.php$ {
			try_files $uri $uri/ =404; # Don't let php execute non-existent php files
			include /etc/nginx/fastcgi_params;
			fastcgi_pass 127.0.0.1:9000;
		}
	}
	
	location /saltwiki/images {
		# Separate location for images/ so .php execution won't apply
		
		location ~ ^/saltwiki/images/thumb/(archive/)?[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ {
			# Thumbnail handler for MediaWiki
			# This location only matches on a thumbnail's url
			# If the file does not exist we use @thumb to run the thumb.php script
			try_files $uri $uri/ @thumb;
		}
	}
	location /saltwiki/images/deleted {
		# Deny access to deleted images folder
		deny	all;
	}
	
	# Deny access to folders MediaWiki has a .htaccess deny in
	location /saltwiki/cache       { deny all; }
	location /saltwiki/languages   { deny all; }
	location /saltwiki/maintenance { deny all; }
	location /saltwiki/serialized  { deny all; }
	
	# Just in case, hide .svn and .git too
	location ~ /.(svn|git)(/|$) { deny all; }
	
	# Hide any .htaccess files
	location ~ /.ht { deny all; }
	
	# Uncomment the following code if you wish to hide the installer/updater
	## Deny access to the installer
	#location /saltwiki/mw-config { deny all; }
	
	# Handling for the article path
	location @mediawiki {
		include /etc/nginx/fastcgi_params;
		# article path should always be passed to index.php
		fastcgi_param SCRIPT_FILENAME	$document_root/saltwiki/index.php;
		fastcgi_pass  127.0.0.1:9000;
	}
	
	# Thumbnail 404 handler, only called by try_files when a thumbnail does not exist
	location @thumb {
		# Do a rewrite here so that thumb.php gets the correct arguments
		rewrite ^/saltwiki/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /saltwiki/thumb.php?f=$1&width=$2;
		rewrite ^/saltwiki/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /saltwiki/thumb.php?f=$1&width=$2&archived=1;
		
		# Run the thumb.php script
		include /etc/nginx/fastcgi_params;
		fastcgi_param SCRIPT_FILENAME	$document_root/saltwiki/thumb.php;
		fastcgi_pass  127.0.0.1:9000;
	}
	
	# [...]
}

 

Edited by lia
  • 2 months later...
Posted

Closing due to inactivity since there has been no response in this thread for over a week. If you're still having this issue or need help with something else please open a new ticket.

Guest
This topic is now closed to further replies.
×
×
  • Create New...