使用JSF 2.3、Jakarta EE 8和Wildfly 23/Payara 5
使用<h:input>
或<p:fileUpload>
上载文件效果良好,但当Nginx打开时会失败。备份bean从未接收到该文件。
- 是否有任何配置可以添加到服务器?(Payara或Wildfly(
- Nginx配置文件肯定有错误吗
app.conf:
upstream payara{
least_conn;
server localhost:8080 max_fails=3 fail_timeout=5s;
server localhost:8181 max_fails=3 fail_timeout=5s;
}
server {
if ($host = nocodefunctions.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
access_log /var/log/nginx/payara-access.log;
error_log /var/log/nginx/payara-error.log;
#Replace with your domain
server_name nocodefunctions.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name nocodefunctions.com;
ssl_certificate /etc/letsencrypt/live/xxxxx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxxx/privkey.pem; # managed by Certbot
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
location /nocodeapp-web-front-1.0 {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://payara$request_uri;
}
location = / {
proxy_pass http://payara;
return 301 https://nocodefunctions.com/nocodeapp-web-front-1.0;
}
}
问题是:我的文件大于nginx上传的大小限制,默认设置为1m。
解决方案包括将client_max_body_size 8M;
(或任何其他值(添加到配置文件中,更多详细信息可在本SO文章中获得。