I am new to Plesk ( and virtual servers in general ). I have a server running CentOS and Plesk 12 and my domain and web site are working perfectly. At present I also have an instance of Dreamfactory running on port 82 (so access it at 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
(effectively masking the port number).
Open sub-domain's "Apache & nginx Settings" and add into "Additional directives for HTTP":
# for Apache
ProxyPass / http://example.com:81/
Or
# for Nginx
location ~ / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://example.com:81;
}
Like this for Apache:
Or like this for nginx:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With