我正在尝试使用 Nginx 创建一个反向代理服务器,我有一个代理配置文件和一个代理 SSL。不幸的是,我在使用代理 SSL (HTTPS)时遇到了一些问题
,当我尝试连接到https://owncloud.example.eu我可以看到日志中有一个服务器名称错误(显示在底部),但我不知道应该编辑什么才能使其正常工作
server {
listen 443 ssl;
server_name example.eu;
ssl on;
ssl_certificate /etc/nginx/ssl/wordpress/wordpress.crt;
ssl_certificate_key /etc/nginx/ssl/wordpress/wordpress.key;
#ssl_trusted_certificate /etc/nginx/ssl/path/ca-certs.pem;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 because of killer poodles
#Uncomment to enable the settings
#gzip on;
location / {
# app1 reverse proxy follow
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_pass https://10.0.2.5:443;
}
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # Webserver 2 # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
server {
listen 443 ssl;
server_name owncloud.example.eu;
ssl on;
ssl_certificate /etc/nginx/ssl/owncloud /owncloud.crt;
ssl_certificate_key /etc/nginx/ssl/owncloud/owncloud.key;
#ssl_trusted_certificate /etc/nginx/ssl/path/ca-certs.pem;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 because of killer poodles
#Uncomment to enable the settings
#gzip on;
location / {
# app1 reverse proxy follow
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_pass https://10.0.2.7:443;
}
}