• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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