我正在使用 nginx 作为 gitlab 的反向代理。通过此代理访问 gitlab 时,我经常遇到注销。显然,gitlab 无法可靠地维护/识别会话。直接访问 gitlab 时(我使用 VPN 直接访问 gitlab,然后通过纯 http)不会发生此问题。有人知道为什么会发生这种情况吗?这是我的 gitlab 的 nginx 配置
server {
listen 443;
listen [::]:443;
server_name gitlab.company.de;
client_max_body_size 0;
include /etc/nginx/ssl.conf;
include /etc/nginx/hsts.conf;
location / {
client_max_body_size 0;
gzip off;
# following line added after penetration test from Nicklas
add_header Set-Cookie "Path=/; HttpOnly; Secure";
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://10.10.90.10;
}
}