Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error][Docker] Return code 413 when uploading image #4

Closed
yry0008 opened this issue Jan 20, 2023 · 3 comments
Closed

[Error][Docker] Return code 413 when uploading image #4

yry0008 opened this issue Jan 20, 2023 · 3 comments
Assignees
Labels
Error help wanted Extra attention is needed

Comments

@yry0008
Copy link

yry0008 commented Jan 20, 2023

I just upload an image to the gallery, and it return the code 413 while uploading. It seems that the upload size is limited by the nginx config.
The Error image is below.
6F11F3C6-5DE0-4632-BFDB-4F659F8A703B

@WeepingDogel WeepingDogel added the bug Something isn't working label Jan 20, 2023
@WeepingDogel WeepingDogel self-assigned this Jan 20, 2023
@WeepingDogel WeepingDogel added Error help wanted Extra attention is needed and removed bug Something isn't working labels Jan 20, 2023
@WeepingDogel
Copy link
Owner

For Native Installation

Edit the nginx configure file /etc/nginx/nginx.conf,

Search for this variable: client_max_body_size. If you find it, just increase its size to 100M, for example. If it doesn’t exist, then you can add it inside and at the end of http.

http {
    include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 100M;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

Then restart the service, you can execute the progress by systemd:

sudo systemctl restart nginx

Or

nginx -s reload

For docker

We are fixing now!

@WeepingDogel
Copy link
Owner

For docker

We have previously created a nginx.conf, copy and replace the origin one.

COPY ./nginx.conf /etc/nginx/nginx.conf

@WeepingDogel
Copy link
Owner

Fixed!

2023-01-29 17-25-14屏幕截图

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants