我在 Nginx PHP-FPM 之上运行我的 Laravel 应用程序。我有一个功能请求,要求网页允许最多 100 MB 的视频上传。我不想要的是打开整个请求以允许 100MB。
这是我最初的 nginx 设置:
server {
listen 80;
listen [::]:80;
root /path-to-web/public;
index index.php index.html;
server_name www.myweb.com;
client_max_body_size 18m;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
fastcgi_send_timeout 180s;
fastcgi_read_timeout 180s;
# pass the PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param PHP_VALUE "newrelic.appname=www.myweb.com";
}
}
server {
listen 443;
listen [::]:443;
ssl on;
ssl_certificate /path-to-cert/cert.pem;
ssl_certificate_key /path-to-cert/cert.key;
root /path-to-web/public;
index index.php index.html;
server_name www.myweb.com;
client_max_body_size 18m;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
proxy_connect_timeout 180s;
proxy_send_timeout 180s;
proxy_read_timeout 180s;
fastcgi_send_timeout 180s;
fastcgi_read_timeout 180s;
# pass the PHP scripts to FastCGI server
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param PHP_VALUE "newrelic.appname=www.myweb.com";
}
}
慕虎7371278