imported>Malacology |
imported>Malacology |
(未显示同一用户的1个中间版本) |
第76行: |
第76行: |
| 编辑 <code>/usr/share/webapps/mediawiki/LocalSettings.php</code> | | 编辑 <code>/usr/share/webapps/mediawiki/LocalSettings.php</code> |
| $wgLogos = [ '1x' => "$wgResourceBasePath/logo.png" ]; | | $wgLogos = [ '1x' => "$wgResourceBasePath/logo.png" ]; |
|
| |
| $wgLogo = "$wgResourceBasePath/logo.png"; | | $wgLogo = "$wgResourceBasePath/logo.png"; |
|
| |
| $wgFavicon = "$wgResourceBasePath/favicon.ico"; | | $wgFavicon = "$wgResourceBasePath/favicon.ico"; |
| listen 80;
| | [[分类:Server]] |
| | | [[分类:Linux]] |
| server_name knwl.malacology.net;
| |
| | |
| return 301 <nowiki>https://$server_name$request_uri</nowiki>;
| |
| | |
| }
| |
| | |
| server {
| |
| | |
| listen 443 ssl http2;
| |
| | |
| server_name knwl.malacology.net;
| |
| | |
| root /usr/share/webapps/mediawiki;
| |
| | |
| ssl_certificate /etc/letsencrypt/live/malacology.net/fullchain.pem;
| |
| | |
| ssl_certificate_key /etc/letsencrypt/live/malacology.net/privkey.pem;
| |
| | |
| ssl_session_cache builtin:1000 shared:SSL:10m;
| |
| | |
| ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
| |
| | |
| ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
| |
| | |
| ssl_prefer_server_ciphers on;
| |
| | |
| access_log /var/log/nginx/mediawiki_access.log;
| |
| | |
| location / {
| |
| | |
| index index.php;
| |
| | |
| try_files $uri $uri/ @mediawiki;
| |
| | |
| }
| |
| | |
| location @mediawiki {
| |
| | |
| rewrite ^/(.*)$ /index.php;
| |
| | |
| }
| |
| | |
| location ~ \.php$ {
| |
| | |
| include /etc/nginx/fastcgi_params;
| |
| | |
| fastcgi_pass unix:/var/run/php-fpm7/php-fpm.sock;
| |
| | |
| fastcgi_index index.php;
| |
| | |
| fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
| |
| | |
| try_files $uri @mediawiki;
| |
| | |
| }
| |
| | |
| location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
| |
| | |
| try_files $uri /index.php;
| |
| | |
| expires max;
| |
| | |
| log_not_found off;
| |
| | |
| }
| |
| | |
| # Restrictions based on the .htaccess files
| |
| | |
| location ~ ^/(cache|includes|maintenance|languages|serialized|tests|images/deleted)/ {
| |
| | |
| deny all;
| |
| | |
| }
| |
| | |
| location ~ ^/(bin|docs|extensions|includes|maintenance|mw-config|resources|serialized|tests)/ {
| |
| | |
| internal;
| |
| | |
| }
| |
| | |
| location ^~ /images/ {
| |
| | |
| try_files $uri /index.php;
| |
| | |
| }
| |
| | |
| location ~ /\. {
| |
| | |
| access_log off;
| |
| | |
| log_not_found off;
| |
| | |
| deny all;
| |
| | |
| }
| |
| | |
| location /rest.php {
| |
| | |
| try_files $uri $uri/ /rest.php?$args;
| |
| | |
| }
| |
| | |
| }
| |