• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Problem changing root of subdomain in plesk 11.5 with apache+nginx

javismiles

Basic Pleskian
dear friends,
im a bit desperate about this issue, i hope you can help me

I have a centos 6 , plesk 11.5 latest version all updates in,
i have a domain.com set on /var/www/vhosts/domain.com/httpdocs

now i have created a subdomain secure.domain.com, with cname pointings to main one (secure->domain.com) , i need it to point to same folder than main domain so i pointed it to the main folder of domain.com by
creating a custom vhost.conf for apache and that works great, as i see htaccess is getting processed so i assume apache is now pointing correctly

but nginx is pointing still to wrong folder, logical as i can see that the last_nginx.conf file is pointing to wrong place

so i found the thread http://forum.parallels.com/showthread.php?260814-Nginx-configuration-for-vhosts
and i followed the indications there but its not working for me,

- i have edited a file nginxDomainVirtualHost.php
on /usr/local/psa/admin/conf/templates/custom/domain
after copying from the default folder
and i added this as you indicated
<?php if (file_exists($VAR->domain->physicalHosting->vhostDir . '/conf/nginx.conf')): ?>
include <?php echo $VAR->domain->physicalHosting->vhostDir;?>/conf/nginx.conf;
<?php endif ?>

just i wasnt sure where to add it, i added it at the very end before the last }

and then i added an nginx.conf inside
/var/www/vhosts/system/secure.domain.com/conf

and inside i just put
root "/var/www/vhosts/domain.com/httpdocs"

and then i did of course the /usr/local/psa/admin/bin/httpdmng --reconfigure-all
but nothing happened

when i go to secure.domain.com i keep getting 404 nginx errors,
however the apache is pointing to right place because the .htaccess of main folder is getting processed, so apache all good,
but all php and non php pages are failing with 404 nginx errors still

i now tried something different, in plesk 11.5
i went to web server settings of the subdomain
and in extra nginx directives i added
location ~ /$ {
root /var/www/vhosts/domain.com/httpdocs;
}

and then restarted nginx
and now something changed

now when going to secure.domain.com instead of getting a 404 not found,
i get a 403 forbidden

other than that if i try
secure.domain.com/index.php i still get 404 error and same for other files

but now i get a 403 instead of 404 when going to the bare secure.domain.com

other than that i am very puzzled because if i try to go to some php files, the php files get downloaded to the client which is disastrous as people could get the php files from the server,
why are they getting downloaded to the client?


thank you for any help, really appreciate it
best
 
nginx root change in extra nginx directives of plesk 11.5 fails partially

i redirected secure.domain.com changed its root in extra nginx directives in plesk 11.5 to point to the folder of its main domain
and

* When i go to secure.domain.com i get a 403 forbidden:
2014/03/21 23:37:19 [error] 1238#0: *306 directory index of "/var/www/vhosts/domain.com/httpdocs/" is forbidden, client: 50.136.240.224, server: secure.domain.com, request: "GET / HTTP/1.1", host: "secure.domain.com"

* but When i go to any page inside secure.domain.com, for example secure.domain.com/index.php then i get a 404 not found
2014/03/21 23:36:16 [error] 1238#0: *306 open() "/var/www/vhosts/domain.com/secure.domain.com/index.php" failed (2: No such file or directory), client: 50.136.240.224, server: secure.domain.com, request: "GET /index.php HTTP/1.1", upstream: "http://198.50.154.201:7080/index.php", host: "secure.domain.com"
[root@domain nginx]#

what is happening is that when going to secure.domain.com then its picking the root change of the extra nginx directives in plesk

but when going to secure.domain.com/anypage.php
then its reverting back to the old subdomain root and not applying the new one i added in the plesk nginx extra directives

so i have 2 problems,
one is the 403 forbidden error
and the other is why is applying new root only on bare domain and not in pages inside
 
Back
Top