主机论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
12
返回列表 发新帖
楼主: zxxx

请教PVE的8006端口怎么可以改成443

[复制链接]

0

主题

2

回帖

8

积分

新手上路

Rank: 1

积分
8
发表于 2023-2-17 12:16:00 | 显示全部楼层
防火墙玩不转。。玛德。转发后要么两个都能访问,要么两个都不能访问。
chatgpt给我写了七八个规则都不行。。
老哥防火墙转发解决了给我说一下。。
原理就是1端口转发2端口(内部),然后屏蔽2端口的外部访问。或者使用Nginx代理,比较复杂

Web Interface Via Nginx Proxy
https://pve.proxmox.com/wiki/Web_Interface_Via_Nginx_Proxy

  1. apt install nginx
  2. rm /etc/nginx/conf.d/default
  3. rm /etc/nginx/sites-enabled/default
  4. nano /etc/nginx/conf.d/proxmox.conf
复制代码

  1. upstream proxmox {
  2. server "YOUR.FQDN.HOSTNAME.HERE";
  3. }

  4. server {
  5. listen 80 default_server;
  6. rewrite ^(.*) https://$host$1 permanent;
  7. }

  8. server {
  9. listen 443;
  10. server_name _;
  11. ssl on;
  12. ssl_certificate /etc/pve/local/pve-ssl.pem;
  13. ssl_certificate_key /etc/pve/local/pve-ssl.key;
  14. proxy_redirect off;
  15. location / {
  16. proxy_http_version 1.1;
  17. proxy_set_header Upgrade $http_upgrade;
  18. proxy_set_header Connection "upgrade";
  19. proxy_pass https://localhost:8006;
  20. proxy_buffering off;
  21. client_max_body_size 0;
  22. proxy_connect_timeout3600s;
  23. proxy_read_timeout3600s;
  24. proxy_send_timeout3600s;
  25. send_timeout3600s;
  26. }
  27. }
复制代码

  1. systemctl restart nginx
复制代码


After nginx service restarts you should be able to reach the web interface

https://your.fqdn.goes.here

https://your.ip.address.goes.here


ensure that nginx gets only started after the certificates are available

  1. systemctl edit nginx.service
复制代码

  1. [Unit]
  2. Requires=pve-cluster.service
  3. After=pve-cluster.service
复制代码


and save + exit.

Enjoy the web interface on HTTPS port 443
回复

使用道具 举报

29

主题

339

回帖

1139

积分

金牌会员

Rank: 6Rank: 6

积分
1139
发表于 2023-2-17 13:30:52 | 显示全部楼层
这样转发后小鸡就不能链接ssl了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|主机论坛

GMT+8, 2025-4-29 17:57 , Processed in 0.074985 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表