From e138a585d18f31a9673bad5f30d6168edbde7892 Mon Sep 17 00:00:00 2001 From: Jason Kelly Date: Sun, 23 May 2021 14:07:45 +0800 Subject: [PATCH] Setting `client_max_body_size` to 10m. - Removed commented-out nginx config for clarity. --- nginx/development | 2 ++ nginx/production | 59 +-------------------------------------------- nginx/server_config | 1 + 3 files changed, 4 insertions(+), 58 deletions(-) create mode 100644 nginx/server_config diff --git a/nginx/development b/nginx/development index d3898287..cdc90df1 100644 --- a/nginx/development +++ b/nginx/development @@ -5,6 +5,8 @@ upstream web { server { listen 80; + include /etc/nginx/conf.d/server_config; + location / { proxy_pass http://web; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/nginx/production b/nginx/production index c5d83cbf..95225c26 100644 --- a/nginx/production +++ b/nginx/production @@ -6,67 +6,10 @@ server { listen [::]:80; listen 80; - server_name your-domain.com www.your-domain.com; + include /etc/nginx/conf.d/server_config; location ~ /.well-known/acme-challenge { allow all; root /var/www/certbot; } - -# # redirect http to https -# return 301 https://your-domain.com$request_uri; -# } -# -# server { -# listen [::]:443 ssl http2; -# listen 443 ssl http2; -# -# server_name your-domain.com; -# -# # SSL code -# ssl_certificate /etc/nginx/ssl/live/your-domain.com/fullchain.pem; -# ssl_certificate_key /etc/nginx/ssl/live/your-domain.com/privkey.pem; -# -# location ~ /.well-known/acme-challenge { -# allow all; -# root /var/www/certbot; -# } -# -# location / { -# proxy_pass http://web; -# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -# proxy_set_header Host $host; -# proxy_redirect off; -# } -# -# location /images/ { -# alias /app/images/; -# } -# -# location /static/ { -# alias /app/static/; -# } } - -# Reverse-Proxy server -# server { -# listen [::]:8001; -# listen 8001; - -# server_name your-domain.com www.your-domain.com; - -# location / { -# proxy_pass http://web; -# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -# proxy_set_header Host $host; -# proxy_redirect off; -# } - -# location /images/ { -# alias /app/images/; -# } - -# location /static/ { -# alias /app/static/; -# } -# } diff --git a/nginx/server_config b/nginx/server_config new file mode 100644 index 00000000..c9aad8e4 --- /dev/null +++ b/nginx/server_config @@ -0,0 +1 @@ +client_max_body_size 10m;