nginx设置反向代理https

nginx设置反向代理

  1. 打开配置文件
nano /etc/nginx/nginx.conf
  1. 在 http 项中添加目标地址
upstream testapp  {
	server 192.168.0.100:8001;
}
  1. 在 http 项中添加 server
server {
	listen 443 ssl http2 default_server;
	listen [::]:443 ssl http2 default_server;
	server_name test.test123.com;
	root /usr/share/nginx/html;

 	ssl on;
	ssl_certificate /cert_folder/full_chain.pem;
	ssl_certificate_key /cert_folder/private.key;

 	# Load configuration files for the default server block.
 	include /etc/nginx/default.d/*.conf;

	location / {
		proxy_pass http://testapp;
 		proxy_set_header X-Real-IP $remote_addr;
	}
}

你可能感兴趣的:(工具使用)