我们在点击帖子请求Advanced Rest Client时遇到nginx问题。
错误消息 - 上游从上游读取响应头时没有发送有效的HTTP / 1.0头
nginx.conf文件是:
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
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 65;
#gzip on;
upstream uic_entry {
server xx.xx.xx.xx:4005;
}
upstream mid_entry {
server xx.xx.xx.xx:4060;
}
upstream rule_entry {
server xx.xx.xx.xx:4070;
}
upstream spike_entry {
server xx.xx.xx.xx:5005;
}
upstream notification_entry {
server xx.xx.xx.xx:10039;
}
upstream oauth_entry {
server xx.xx.xx.xx:4000;
}
upstream check_entry {
server xx.xx.xx.xx:3000;
}
## our http server at port 80
server {
listen 80;
server_name xx.xx.xx.com;
# redirect http to https
rewrite ^ https://$server_name$request_uri? permanent;
}
## Our https server at port 443
server {
listen 443;
server_name xx.xx.xx.com;
underscores_in_headers on;
ssl on;
ssl_certificate /usr/local/nginx/conf/xxx-server.crt;
ssl_certificate_key /usr/local/nginx/conf/xxx-server.key;
ssl_verify_depth 4;
large_client_header_buffers 8 32k;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
ignore_invalid_headers off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_set_header Accept-Encoding "";
proxy_read_timeout 200;
location ~\.(js|css|png|jpg|jpeg|gif|ico)$ {
#root html;
#index index.html index.htm;
#return 503;
proxy_pass http://uic_entry;
}
location ~/(.*)/(v.*) {
proxy_pass http://mid_entry;
}
location /xxxx/ {
proxy_pass http://mid_entry;
}
location /templateservice/middleware/ {
proxy_pass http://mid_entry;
}
location /templateservice/trule/ {
proxy_pass http://rule_entry;
}
location /templateservice/security/ {
proxy_pass http://spike_entry;
}
location /checkAuthentication {
proxy_pass http://check_entry;
}
location /xxxx {
proxy_pass http://oauth_entry;
}
location /xxxx/client_register {
proxy_pass http://oauth_entry;
}
location /xxxx/access_token {
proxy_pass http://oauth_entry;
}
location / {
#root html;
#index index.html index.htm;
#return 503;
proxy_pass http://uic_entry;
}
location /EmailService {
#root html;
#index index.html index.htm;
#return 503;
proxy_pass http://notification_entry;
}
location /NotificationService {
#root html;
#index index.html index.htm;
#return 503;
proxy_pass http://notification_entry;
}
}
}
请帮助我们解决此问题。