Editing Nginx/MediaWiki
From Bibliotheca Anonoma
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{Note|These Nginx configs are written without HTTPS for simplicity, but you should be [https://letsencrypt.org/getting-started/ using SSL certificates from LetsEncrypt.] They're free!}} | {{Note|These Nginx configs are written without HTTPS for simplicity, but you should be [https://letsencrypt.org/getting-started/ using SSL certificates from LetsEncrypt.] They're free!}} | ||
== 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 {{ic|fastcgi_pass php-fpm;}}. Create this file: | 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 {{ic|fastcgi_pass php-fpm;}}. Create this file: | ||
Line 29: | Line 11: | ||
upstream php-fpm { | upstream php-fpm { | ||
#server 127.0.0.1:9000; | #server 127.0.0.1:9000; | ||
server unix:/var/run/php5-fpm.sock; | |||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
== 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: | This is the Nginx Config that we use when when setting up MediaWiki for the first time over conventional HTTP, with PHP-FPM: | ||
Line 156: | Line 137: | ||
listen 80; | listen 80; | ||
server_name img.bibanon.org; | server_name img.bibanon.org; | ||
# images stored here | # images stored here | ||
root /var/www/mediawiki/images; | root /var/www/mediawiki/images/; | ||
# let's encrypt SSL dir | # let's encrypt SSL dir | ||
Line 196: | Line 172: | ||
$wgUploadBaseUrl = 'https://img.bibanon.org'; | $wgUploadBaseUrl = 'https://img.bibanon.org'; | ||
</nowiki>}} | </nowiki>}} | ||