• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Additional nginx directives

andyxyz

Basic Pleskian
I want to add
proxy_set_header X-Forwarded-Proto: https;

(in order to make an application work with ssl / varnish without redirect loops.

When inserted manually like so

Code:
 #extension docker begin
        location ~ ^/.* {
                proxy_pass http://0.0.0.0:32780;
                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-Proto: https;
        }

        #extension docker end

        location / {
                proxy_pass http://78.129.161.190:7080;
                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-Proto: https;
                access_log off;
        }

everything works a treat.

Is there a way to add this to Additional nginx directives ? I know I could create a custom template but I want to apply this on a per domain basis not globally..
 
I think this cannot be added to the "additional directives" because of the nature of the location path. In a custom template however, you can still do this for a single domain only (or a set of domains), because these are PHP files. You could add a case switch (if ... then ... else accordingly) and create different parts of the template depending on the domain name that is being processed.
 
You can use a complete Nginx config file in /etc/nginx/conf.d folder.

I'm using it to have syncthing and ASSP on port 443 using virtual hosting. The daemon is running its plain http webserver on localhost (different port) or sometimes on another server with a self-signed certificate or plain http

I'm doing this all the time.
If the server_name is not defined in Plesk you should start the filename with zz090_

If it is also used in Plesk you will receive a warning that it's a duplicate, but that's not a problem. You should however start the filename with something lower (alphabetically) than zz010_plesk.conf as only the first one will be executed.

One thread of mine is a long monologue where I'm trying to make Plesk's letsencrypt work for a domain it is not actually handling.


The thread "Will this trick keep working?" in the thread "extensions"


I finally was able to solve the letsencrypt thing, but not to full satisfaction. I learned a lot on the process.
I will probably revisit that thread as a better solution would be to write my own letsencrypt provisioning for those domains (outside Plesk and therefore not reliant upon).
 
Last edited:
Back
Top