• 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 Plesk Onyx & nginx: How to define separate settings for HTTP and HTTPS

B_P

Regular Pleskian
Hi all,

while switching to a new system (Ubuntu 12.04 ->16.04) and Plesk Onyx (from 12.5), I see that nginx was enabled automatically. Since this seems to be an interesting combination, I started experimenting...

Now the first question that I have: For Apache, I can define for each website/subdomain custom settings for Apache & nginx. For Apache, these can be different for HTTP and HTTPS. However, for nginx there is only one field. How can I define different settings for HTTP and HTTPS?

- This is for instance necessary for HTTP to HTTPS redirects (where the redirect is only required on the HTTP port). Here separate configuration settings would be helpful to prevent the execution of additional regular expressions and if statements...
 
Hi B_P,
surprise, surprise... Plesk may solve this for you: => HOME > Domains > (sub)domain > Hosting Settings >


Well, I have a special case which I use to facilitate accessing the plesk panel:
- The Plesk panel is located at https://plesk.domain.tld:8443/ and is expected to use a Let's encrypt certificate
- The server also hosts domain.tld
- Any access to plesk.domain.com (HTTP, HTTPS on regular ports) should be redirected to the Plesk URL
- ... except those which are required for the validation of the Let's encrypt certificates (/.well-known/acme-challenge/.*)

To simplify the access, I created a subdomain plesk.domain.tld. Now the idea is the following (works with Apache and Plesk 12.5):
a) When accessing http://plesk.domain.tld/ (or any location on this subdomain except those for Let's encrypt), I get redirected to http://plesk.domain.tld/:
RedirectMatch 301 ^(?!/\.well-known/acme-challenge/).* https://plesk.domain.tld$0 (additional HTTP directives used with Plesk 12.5)
b) When accessing https://plesk.domain.tld (or any location on this subdomain), I get redirected to https://plesk.domain.tld:8443/
Redirect permanent / https://plesk.domain.tld:8443/ (additional HTTPS directives used with Plesk 12.5)

How would this work with nginx?

In addition, I assume that there are other cases where different settings may be required for HTTP and HTTPS...
 
Hi B_P,

am I correct, that you opened the thread, because of Let's Encrypt and the desire to secure the server - hostname with a Let's Encrypt certificate? Well good news... pls. visit: => #5


If you desire to redirect visitors from any URL ( of your hosted domains on your server ) with the port specification ":8443" to an URL of your choice ( i.e. https://plesk.YOUR-DOMAIN.COM:8443 ), you would follow:



Could you pls. post the corresponding log from Let's Encrypt, if you experience any issues, when trying to create a certificate for your (sub)domain? You should NOT need any apache ( or nginx ) rewrites, when you use the Plesk - Let's Encrypt - Extension. ;)
 
Back
Top