Plesk 中具有不同端口的子域

Sub Domain with different ports in Plesk

如果这是一个愚蠢的问题,我深表歉意,但我是 Plesk 的新手(和一般的虚拟服务器)。我有一台服务器 运行 Centos 和 Plesk 12,我的域和网站运行良好。目前我在82端口也有一个Dreamfactory 运行的实例(所以在http://example.com:81 ) but I wondered if it were possible to setup a subdomain with plesk such as http://api.example.com that would load my dream factory instance without forwarding to http://example.com:81访问它(有效屏蔽端口号)。

打开子域的 "Apache & nginx Settings" 并添加到 "Additional directives for HTTP":

# for Apache
ProxyPass / http://example.com:81/

# for Nginx
location ~ / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://example.com:81;
}

Apache 就像这样:

或者像 nginx 这样的: