我需要将 nginx 配置为 docker 中运行的某些应用程序的反向代理。Portainer 运行良好,但 HashiCorp Vault 仍然存在问题。进一步的步骤将使用 nginx 为所有正在运行的应用程序进行 SSL 连接。所有应用程序都是最简单的设置,我可以在没有任何特殊功能的情况下使用。
用户 nginx;
工作进程 1;
error_log /var/log/nginx/error.log 调试;
pid /var/run/nginx.pid;
事件{
工人连接1024;
}
http{
包括/etc/nginx/mime.types;
default_type 应用程序/八位字节流;
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 /var/log/nginx/access.log main;
发送文件;
#tcp_nopush 上;
keepalive_timeout 65;
#gzip 开启;
服务器 {
听80;
服务器名称 1.2.3.4;
位置/porttainer/ {
proxy_pass http://1.2.3.4:9000/;
重写 ^/portainer(/.*) $1 中断;
proxy_redirect 关闭;
proxy_set_header 主机 $host;
proxy_set_header X-真实IP …