• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

Question nginx reverse proxy directive for "location /" for specific domain only

davewood

New Pleskian
I want to proxy all requests on a specific domain to another server. (Plesk Obsidian)

i have a few sites configured

portal.example.com
foo.example.com
bar.example.com

all requests to portal.example.com should be proxied to portal.internalserver.com


Hosting Settings
hosting type: website

Apache & nginx Settings
nginx proxy mode: deactivated
Additional nginx directives:
Code:
location / {
    proxy_pass       http://portal.internalserver.com:8000;
    proxy_redirect   off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $server_name;
}

this directive doesnt matche because its included after the default templates location directive.

custom templates seem to be the answer but I cannot figure out how to restrict a custom template to a specific subdomain.

Here are a few links that I came across while looking for an answer:
 
I'm also looking on a way to resolve this.

I'm hosting additional server, with dockered NextCloud instances and since my public IP addresses are limited I cannot assign one to to NextCloud machine to manage nginx vhosts there, and use default 443 port for hosting.
I've tried to proxy pass requests from subdomains to my NextCloud instance but to no avail.
Using Plesk would be not only technically easier but way more convenient - Plesk could manage LetsEncrypt certificartes, domains, and nginx logs...

So far I was able to proxy additional locations (not subdomains), like /nextcloud - as this does not duplicate location "/" in the nginx additional directives field.
 
Back
Top