Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion reverse_proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ http {
types_hash_max_size 2048;
server_tokens off;

client_max_body_size 20m;
# See webserver/README.md to understand upload limits.
client_max_body_size 11M;
client_body_timeout 60;
client_body_buffer_size 128k;

Expand Down
26 changes: 25 additions & 1 deletion webserver/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# webserver

This folder contains the resources necessary to build the RopeWiki webserver Docker image.
This folder contains the resources necessary to build the RopeWiki webserver Docker image.


## Upload limits
There are 4 places which effect the upload limit, in order they are:
- reverse_proxy (nginx)
- webserver (nginx)
- php config
- mediawiki config

### nginx
Nginx will return a HTTP 413 error if `client_max_body_size` is exceed by an uploaded file.

This is a "hard" error, and will likely give the user an ugly error page. Therefore it's
important that this value is equal to or higher than the php/mediawiki value.

Both the webserver & reverse_proxy need this value set. It's set at the global (http {...})
level to avoid confusion around different paths getting different limits.

### Mediawiki
Mediawiki will pick whichever of these three is the lowest, and give a "soft" error before
the upload begins:
- `upload_max_filesize` (php.ini)
- `post_max_size` (php.ini)
- `wgMaxUploadSize`, defaults to 100MB (LocalSettings.php)
2 changes: 1 addition & 1 deletion webserver/html/ropewiki/LocalSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@

# ===================================================

# Upload limits are set in php.ini (upload_max_filesize)
# See README.md to understand upload limits.
#$wgUploadSizeWarning = 5242880;
#$wgMaxUploadSize = 5242880;

Expand Down
3 changes: 2 additions & 1 deletion webserver/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

client_max_body_size 20m;
# See webserver/README.md to understand upload limits.
client_max_body_size 11M;
client_body_buffer_size 128k;

access_log /var/log/nginx/access.log;
Expand Down
3 changes: 1 addition & 2 deletions webserver/nginx/sites-enabled/ropewiki.com
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
#add_header Access-Control-Allow-Origin www.ropewiki.com;
client_max_body_size 5M;
#add_header Access-Control-Allow-Origin www.ropewiki.com;
root /usr/share/nginx/html/ropewiki;
index index.php index.html index.htm;

Expand Down
Loading