nginx双向代理

Monday, Sep 23, 2024 | 1 minute read | Updated at Monday, Sep 23, 2024

@
nginx双向代理

使用nginx当双向代理

server{
	server_name 10.10.110.10 ssl;
	listen 16002;
	
	ssl_certificate /path/to/your_certificate.crt;
	ssl_certificate_key /path/to/your_private.key;
	ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;
	ssl_session_cache shared:SSL:10m;
	ssl_session_timeout 10m;
	ssl_prefer_server_ciphers on;

	# 转发node --> center
	location /webchat/openapi/v1 {
		proxy_pass https://10.10.110.12:16002;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
	}
	
	# center --> node	
	location /webChatClient/openapi/v1 {
		proxy_pass https://10.10.110.20:8123;
		proxy_set_header Host $host;
		proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
	}
}

© 2016 - 2025 Caisong's Blog

🌱 Powered by Hugo with theme Dream.

About Me

大龄程序员,喜欢折腾各种环境部署、软件应用。

博客记录日常。