Nginx/MediaWiki

PHP-FPM Nginx Config
To make it easy to switch all our present or future PHP apps between TCP ports and UNIX sockets, we use a specific `php-fpm.conf` file which can be called with. Create this file:

MediaWiki Nginx Config
This is the Nginx Config that we use when when setting up MediaWiki for the first time over conventional HTTP, with PHP-FPM:


 * Path to Mediawiki installation:


 * Source: BigDinosaur Blog: Mediawiki with Nginx

After setting up MediaWiki, make sure to uncomment the  block to allow index.php to be used, and the   line to disable access to the installation directory.

Also consider setting up an SSL certificate with this Nginx config.

Serving MediaWiki images with Nginx
Nginx can be optimized to make image serving more efficient, and block hotlinking. Since the settings for static images often differ greatly from that of dynamic text, it is recommended that you create a specific subdomain just for images (such as ) and serve your image folder from there.

Here is the Nginx config we used (without SSL) to serve our image folder:

After setting this up, just add this line to LocalSettings:

https://serversforhackers.com/nginx-caching