• 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.

Plesk 11.5, selected site on default IP via HTTPS -- problem

Maxim Makarenko

New Pleskian
Hello,

I have Plesk 11.5 installed on my server. There are about 30 sites on the same shared IP address. I need to set up a site to be accessible via https://<ip-address-of-the-server> .

According to the documentation I went to Setting -> IP Addresses and selected the desired site from the drop down. Now http://<ip-address-of-the-server> (note, 80th port) works like a charm. Unfortunately https:// displays only the first page of the selected site; all CSS, JS and other files are not found (404).

I did some research and found that Nginx forwards the requests to Apache for all the PHP files and tries to handle all the static files by itself (what is expected and correct). But it looks like that there is no special configuration for nginx which would specify where to get these static files for the IP address, and Nginx just uses the first loaded config (started from b in my case).

I temporary resolved this issue by modifying the last_nginx.conf for the desired domain this way:

listen XX.XX.XX.XX:443 default_server ssl;

Note I added "default_server" directive. Of course it would be erased on each reconfiguration of the config files, but as for now I do not see how I can put it in custom nginx.conf or on the server servel level. I reckon Plesk should include the directive in the file the same way as it produces last_httpd_ip_default.conf Apache config for the selected domain. It looks to be an easy fix on the template level, may be I will do it later, but for now this is just the bug report.
 
Fast fix:

1. Create the folder for custom templates:
mkdir /usr/local/psa/admin/conf/templates/custom/domain

2. Copy the original template as the basis for the custom templae:
cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/

3. Modify the line with "listen" directive this way:

listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . (($OPT['ipAddress']->defaultDomainId == $VAR->domain->id && $OPT['ssl']) ? ' default_server ' : '' ) . ($OPT['ssl'] ? ' ssl' : '') ?>;

4. Reconfigure:
/usr/local/psa/admin/bin/httpdmng --reconfigure-all

An alternative would be to set up default_server for HTTPS/443 in /etc/nginx/plesk.conf.d/server.conf, but this is a pain to put correct certificates settings into the file. So I decided to do it on the domains level.

I tested the fix and it works perfectly.
 
Back
Top