• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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