Re: Не получается загрузить файлы на сервер
igor.korotkov
nginx-forum на forum.nginx.org
Вт Янв 30 10:23:03 UTC 2018
Нет, с размером там всё в порядке, 100м стоит. Загружаемые файлы значительно
меньше.
P.S. в форме ранее пропущено - enctype="multipart/form-data"
myserver.conf
-------------------
server {
listen 80;
server_name myserver.ru www.myserver.ru;
return 301 https://myserver.ru$request_uri;
}
server {
listen 443 ssl http2;
server_name myserver.ru;
access_log /var/log/nginx/myserver.ru.access.log main;
error_log /var/log/nginx/myserver.ru.error.log debug;
location '/.well-known/acme-challenge' {
default_type "text/plain";
root /tmp/letsencrypt-auto;
}
ssl on;
ssl_session_cache shared:SSL:2m;
ssl_stapling on;
ssl_stapling_verify on;
resolver_timeout 10s;
ssl_certificate /etc/letsencrypt/live/myserver.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/myserver.ru/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
root /var/www/html/myserver.ru/;
index index.php;
charset utf-8;
location / {
root /var/www/html/myserver.ru;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last;
}
}
location /rulers/ {
root /var/www/html/myserver.ru;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?action=manager&$1 last;
}
}
location /api {
root /var/www/html/myserver.ru;
if (!-e $request_filename) {
rewrite ^/(.*)$ /sttapi.php?$1 last;
}
}
location /api2 {
try_files $uri $uri/ /sttapi.php;
}
location ~ \.php$ {
root /var/www/html/myserver.ru/;
fastcgi_pass unix:/var/run/php-fpm/myserver.ru.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
nginx.conf
--------------
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
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 /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
send_timeout 60;
types_hash_max_size 2048;
client_max_body_size 100m;
index index.php index.html;
default_type application/octet-stream;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types text/plain text/css application/json application/x-javascript
text/xml application/xml appliction/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
}
Posted at Nginx Forum: https://forum.nginx.org/read.php?21,278292,278294#msg-278294
Подробная информация о списке рассылки nginx-ru