全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
12
返回列表 发新帖
楼主: zxxx
打印 上一主题 下一主题

[疑问] 请教PVE的8006端口怎么可以改成443

[复制链接]
11#
 楼主| 发表于 2023-2-17 23:01:21 | 只看该作者
或者使用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_timeout  3600s;
  23.         proxy_read_timeout  3600s;
  24.         proxy_send_timeout  3600s;
  25.         send_timeout  3600s;
  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
12#
发表于 2023-2-17 23:08:45 | 只看该作者
这样转发后小鸡就不能链接ssl了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-9-21 18:01 , Processed in 0.057091 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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