我有一个 CSV 下载,使用 Docker、Nginx 和 PHP-FPM,一切运行良好,直到下载变得更大然后 2-3 MB。生成的 CSV 文件存在于 php 容器中(在我的 tmp 目录 /var/www/symfony/var/tmp/... 看起来不错),但 Nginx 无法为它们提供服务。Nginx 错误日志显示了这一点
2019/05/09 12:09:29 [crit] 7#7: *747 open() "/var/tmp/nginx/fastcgi/2/07/0000000072" failed (13: Permission denied) 同时读取上游,客户端: 172.18.0.1, server: , request: "GET /catalog-download HTTP/1.1", upstream: "fastcgi://172.18.0.3:9001", host: "localhost", referrer: " http://localhost/目录”
看起来我的 csv 文件不在那里,Nginx 或其他人应该将它们移到 Nginx tmp 文件夹中。
有一些关于 Nginx 下载问题的帖子,但大多数都有 300MB 和更大的问题。所以我认为我的问题是不同的。下载很好,但限制 < ~2-3MB。
Nginx 配置是
user www;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 2048;
multi_accept on;
use epoll;
}
http {
server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 15;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log off;
error_log off;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
open_file_cache max=100;
client_body_temp_path /tmp 1 2;
client_body_buffer_size 256k;
client_body_in_file_only off;
client_max_body_size 50M;
}
和
upstream php-upstream {
server php:9001;
}
server {
listen 80;
server_name mydomain.tk;
server_tokens off;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name mydomain.tk;
server_tokens off;
ssl_certificate /etc/letsencrypt/live/mydomain.tk/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.tk/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
root /var/www/symfony/public;
location / {
try_files $uri /index.php$is_args$args;
}
慕桂英4014372
狐的传说