首先请原谅这个问题是否简单。
我有一台装有 Ubuntu 和 nginx 的服务器。使用时始终有效http
,但在添加证书并尝试启用后,https
我收到此错误nginx: [emerg] host not found in upstream "api"
。
这是我的配置:
upstream api {
least_conn;
server 176.9.91.243:7123;
}
upstream api2 {
least_conn;
server 176.9.32.170:7123;
}
server {
# listen 80;
listen 443;
ssl on;
ssl_certificate /etc/ssl/chain.crt;
ssl_certificate_key /etc/ssl/ssl_key.key;
add_header Strict-Transport-Security "max-age=31536000";
add_header Content-Security-Policy "block-all-mixed-content";
root /var/www/hosting;
index index.html index.htm;
client_max_body_size 15m;
server_name serverName.com;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
set …
Run Code Online (Sandbox Code Playgroud)