我正在运行安装了VestaCP的VPS。 Web面板在端口8083上运行。 我已经设法得到它在panel.domain.com工作,但是,面板中的一些URL在使用子域时会失去function。
我想知道如何让端口8083指向domain.com/panel 。
这是我在我的nginxconfiguration中尝试过的:
server { listen 108.xx.xx.xxx:443; server_name domain.com; root /var/www/ghost; index index.html index.htm; location /panel { proxy_pass https://127.0.0.1:8083; } }
如果你想通过domain.com/panel访问你的VestaCP控制面板,你可以使用这个nginxconfiguration:
server { listen 108.xx.xx.xxx:443; server_name domain.com; root /var/www/ghost; index index.html index.htm; location ~ /panel(.*)$ { rewrite ^ https://domain.com:8083$1 permanent; } }
这使得nginx将以/panel开头的所有URI的301redirect发送到https://domain.com:8083 ,因此您可以通过https://domain.com/panel访问该面板。
但是,在VestaCP面板中生成的所有URL仍然直接指向https://domain.com:8083 。 如果你想改变这些开始https://domain.com/panel ,你需要修改VestaCP。 VestaCP可能没有select直接更改域,所以你可能需要直接修改VestaCP代码,我不build议。
什么是端口8083上运行的是你的网页面板,我认为这不是基于Nginx的。 为了使端口8083“指向”任何东西,你需要定制你的Web面板的行为,而不是Nginx。
也许你想要与你所要求的相反,让Nginx监听端口80或433,并将domain.com/panelredirect或代理到web面板?
你还应该澄清你的“指向”语言是“redirect到”还是“代理到”。