我在个人gitlab设置中遇到了一个小问题.我想重定向从http://gitlab.example.com到https://gitlab.example.com的所有流量.SSL确实在https://gitlab.example.com上运行,但必须专门打字.下面是我的Nginx conf文件.
server {
listen 192.168.1.139:443;
server_name gitlab.example.com;
listen 443;
ssl on;
ssl_certificate /etc/Nginx/ssl/gitlab.crt;
ssl_certificate_key /etc/Nginx/ssl/gitlab.key;
location / {
proxy_pass http://192.168.1.139:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header x-Forwarded-For $proxy_add_x_forwarded_for;
}
}
最佳答案