我需要知道是否有可能使用Nginx作为反向代理服务于不同Raspberry Pi中的多个web应用程序。
从图表中可以看到,Raspberries将全部连接到一个非托管交换机,这是我打算安装的第一个交换机,这样它就可以作为反向代理,这取决于从互联网请求的网站。Www.site1.com,www.site2.www等
这个是可能的吗?我是否能够从连接到调制解调器的计算机上访问这些RPis,而不是连接到交换机?
注意:调制解调器是wifi调制解调器,交换机是非托管有线交换机。
很抱歉我的绘画技巧很差,谢谢你的帮助。在买这些东西之前,我需要知道这个想法是否可行。

发布于 2019-02-02 04:10:25
这是head节点侧的nginx conf:
server {
listen 80;
server_name www.codingindfw.com codingindfw.com;
location / { rewrite ^ https://$host$request_uri permanent;}
}
server{
listen 443 ssl;
server_name www.codingindfw.www codingindfw.com;
client_max_body_size 4G;
ssl_certificate /etc/letsencrypt/live/www.koohack.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/www.koohack.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://192.168.0.8;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
port_in_redirect off;
proxy_redirect http://192.168.0.8/ /;
}
}这是运行实际Django应用程序的客户机上的nginx conf文件:
server {
listen 80 default_server;
server_name www.codingindfw.com;
client_max_body_size 4G;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/pi/coding-in-dfw;
}
location /media/ {
root /home/pi/coding-in-dfw;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/pi/coding-in-dfw/mysocket.sock;
}
}https://stackoverflow.com/questions/53772810
复制相似问题