|
|
Ligne 42 : |
Ligne 42 : |
|
| |
|
| = [http://wiki.nginx.org/MediaWiki Mediawiki] = | | = [http://wiki.nginx.org/MediaWiki Mediawiki] = |
| == Pretty URL avec uwsgi ==
| |
| <filebox fn=/etc/nginx/nginx.conf lang=bash>
| |
| # only in production
| |
| error_page 403 404 = /index.php;
| |
|
| |
| location ~ \.php5?$ {
| |
| include uwsgi_params;
| |
| uwsgi_modifier1 14;
| |
| uwsgi_pass unix:/run/uwsgi/mediawiki.sock;
| |
| }
| |
|
| |
| location ^~ /wiki/ {
| |
| rewrite ^/wiki/(.*)$ /index.php?title=$1;
| |
| }
| |
|
| |
| # Restrictions based on the .htaccess files
| |
| location ^~ /cache/ { deny all; }
| |
| # location ^~ /images/ {}
| |
| location ^~ /images/deleted/ { deny all; }
| |
| location ^~ /images/temp/ { deny all; }
| |
| location ^~ /includes/ { deny all; }
| |
| location ^~ /languages/ { deny all; }
| |
| location ^~ /maintenance/ { deny all; }
| |
| location ^~ /maintenance/archives/ { deny all; }
| |
| location ^~ /serialized/ { deny all; }
| |
| location ^~ /tests/ { deny all; }
| |
| # location ^~ /tests/qunit/ { allow all; }
| |
| location ^~ /extensions/MobileFrontend/dev-scripts/ { deny all; }
| |
| # location ^~ /extensions/MobileFrontend/tests/ {}
| |
|
| |
| # Restrictions d'accès supplémentaires
| |
| location ^~ /mw-config/ { deny all; }
| |
| location ^~ /extensions/ { deny all; }
| |
| location ^~ /resources/ { deny all; }
| |
| location ^~ /resources/assets/ { allow all; }
| |
| location ^~ /docs/ { internal; }
| |
| location ^~ /vendor/ { internal; }
| |
| # Hide any .htaccess files
| |
| location ~ /.ht { deny all; }
| |
|
| |
| location ~* \.(js|css|png|jpg|jpeg|svg|gif|ico)$ {
| |
| try_files $uri /index.php;
| |
| expires max;
| |
| }
| |
| </filebox>
| |
| <filebox fn=LocalSettings.php lang=php>
| |
| $wgArticlePath = "/wiki/$1";
| |
| </filebox>
| |
|
| |
| == Pretty URL avec php-fpm == | | == Pretty URL avec php-fpm == |
| <filebox fn=/etc/nginx/nginx.conf lang=bash> | | <filebox fn=/etc/nginx/nginx.conf lang=bash> |