现在想改造一下访问方式变成访问:
https://192.168.2.180:9444/chat 可以访问到部署的 chatgpt: http://192.168.2.4:50021
https://192.168.2.180:9444/pve 可以访问到 PVE 虚拟机 https://192.168.2.2:8006/
https://192.168.2.180:9444/adguard/ 可以访问到 adguard 的应用 http://192.168.2.200/
但是按照下面的配置,访问到的页面不全,页面各种缺失。
是不是这样的方法不适用??
worker_processes auto;
events {
worker_connections 1024;
}
http {
server {
listen 9444 ssl;
server_name 192.168.2.180;
ssl_certificate /etc/nginx/ssl.crt;
ssl_certificate_key /etc/nginx/ssl.key;
location /chat/ {
proxy_pass http://192.168.2.4:50021/;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /pve/ {
proxy_pass https://192.168.2.2:8006/;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
sub_filter_types *;
}
location /adguard/ {
proxy_pass http://192.168.2.200/;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "";
sub_filter_types *;
}
}
}
proxy_set_header, Nginx, x-real-ip, proxy_pass