• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • 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.

Input How to use Multiple IP's for 1 Domain [IMPORTANT FEATURE THAT'S MISSING NATIVELY]

boostedhost

New Pleskian
Server operating system version
Ubuntu 20 & 22
Plesk version and microupdate number
18
Assigning two different IPs to one website is absolutely possible. Let me explain how, as it took me quite a bit of headache to figure this out.

Step 1:
Add the secondary IP to your Plesk server, but don't assign it to any websites. You don’t need to associate it directly with any domain.

Step 2:
FTP into your server and navigate to /opt/psa/admin/conf/templates/default/domain. Open the nginxDomainVirtualHost.php file.

In this file, you’ll see a lot of code, but don’t worry—you only need to add four lines. Here's what to add:

PHP:
server {
<?php if ($OPT['ssl'] && $OPT['http3']) : ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] ?> quic;


--->listen YOUR SECOND IP:<?php echo $OPT['frontendPort'] ?> quic; <---


add_header Alt-Svc <?php echo '\'h3=":' . $OPT['frontendPort'] . '"; ma=86400\'' ?>;
<?php endif; ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>;


---->listen YOUR-SECOND-IP:<?php echo $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>; <---


<?php if ($OPT['ssl'] && $OPT['http2']) : ?>
http2 on;
<?php endif; ?>

Further down in the file, you’ll find another similar block. Update it as well:

PHP:
server {
<?php if ($OPT['ssl'] && $OPT['http3']) : ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] . ' quic' . ($OPT['default'] ?  ' reuseport' : '') ?>;

--->listen YOUR-SECOND-IP:<?php echo $OPT['frontendPort'] ?> quic; <------

add_header Alt-Svc <?php echo '\'h3=":' . $OPT['frontendPort'] . '"; ma=86400\'' ?>;
<?php endif; ?>
listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] .
($OPT['default'] ? ' default_server' : '') . ($OPT['ssl'] ? ' ssl' : '') ?>;

---->listen YOUR-SECOND-IP:<?php echo $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>; <----

<?php if ($OPT['ssl'] && $OPT['http2']) : ?>
http2 on;
<?php endif; ?>

Make sure to remove the --> and <-- markers, and replace "YOUR-SECOND-IP" with the actual IP you’re adding.

Final Step:
Restart NGINX with
Code:
systemctl restart nginx
and regenerate all domain configurations on your Plesk server by running the following command via SSH:
Code:
plesk repair web -y
 
Please do not edit the default templates directly because they WILL get overwritten. Instead, the best way to edit it would be to to make a copy of the template you want to edit (nginxDomainVirtualHost.php in this case) to /usr/local/psa/admin/conf/templates/custom (so in your case, you'll want to copy /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php to /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php)

You can refer to Changing Virtual Hosts Settings Using Configuration Templates for how to properly edit the templates to further customize it to your needs.
 
Back
Top