网站访问结果:
![image.png image.png](data/attachment/forum/202401/18/164934bmofheqmemjvzccc.png)
nginx相关配置
{
listen 80;
server_name a.baidu.com;
index index.html index.htm default.php default.htm default.html;
root /www/wwwroot/a.baidu.com;
location / {
# 用于配合 browserHistory使用
try_files $uri $uri/ /index.html;
}
location /jeecgboot/ {
proxy_pass http://127.0.0.1:8089/jeecg-boot;
proxy_redirect off;
#真实IP获取
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
set $my_proxy_add_x_forwarded_for $proxy_add_x_forwarded_for;
if ($proxy_add_x_forwarded_for ~* "127.0.0.1"){
set $my_proxy_add_x_forwarded_for $remote_addr;
}
proxy_set_header X-Forwarded-For $my_proxy_add_x_forwarded_for;
}
}
|