我有一个在 Glassfish 应用服务器上运行的 JSF Web 应用程序。我使用 Nginx 反向代理 Glassfish。我想看看 Nginx 的性能提升,我正在使用 JMeter 测试应用程序。当我直接在 glassfish 上测试应用程序时,没有错误计数。但是,当我通过 Nginx 测试应用程序时,响应包含大量错误计数,大约 %80。我在 nginx 配置文件中更改了一些超时,但没有任何变化。
我的 Nginx Conf 文件;
#user nobody;
worker_processes 3;
worker_rlimit_nofile 1024;
worker_priority -6;
#worker_cpu_affinity 01 10;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
multi_accept on;
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#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 120m ;
#gzip on;
#upstream glassfish {
# server 127.0.0.1:28080;
# server 127.0.0.1:28081;
# }
server {
listen 8070;
server_name localhost;
root "html";
#charset utf-8;
#access_log logs/host.access.log main;
location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ {
#autoindex on;
access_log off;
expires max;
}
location / {
access_log off;
proxy_pass http://localhost:8080/; >> to Glassfish port
#proxy_pass http://localhost:43842/;
#proxy_pass http://glassfish;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 120m;
proxy_connect_timeout 120m;
}
#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 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;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
有什么问题??