我使用nginx充当2台服务器之间的代理。我有一个域以及附属于IP的子域。由于不知所措,我需要通过子域将请求发送到第三个IP。 我遇到的一个问题是有休息的服务器之间的通信。我对Webapp进行的任何操作都会导致
无法加载资源:net :: ERR_CERT_COMMON_NAME_INVALID
我一直在试图解决这个问题,但我收到了一个登录请求才能通过,但是此后一切都停止了。
我已设置的域,并且一切正常,子域如下所示
server {
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
server_name api.example.com www.api.example.com;
location / {
proxy_pass "http://x.x.x.x:8080$request_uri";
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Client-Verify SUCCESS;
proxy_set_header X-Client-DN $ssl_client_s_dn;
proxy_set_header X-SSL-Subject $ssl_client_s_dn;
proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
proxy_read_timeout 1800;
proxy_connect_timeout 1800;
}
}
我对nginx相对较新,但是对我来说,这应该可以作为代理。我已经调用了一个请求,但是在那之后失败了,可能是防火墙/网络问题?