• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Nginx directive change root (For Plesk pro user)

Lrnt

Basic Pleskian
Hi,

Until now, I have a "website" that store files on "my.project"
"my.project" is my real domain name (subscription) in Plesk, it means that "my.project" is not directly accessible through the internet.

I have a domain (eg: coolsite.com) with email account.
I set a Apache directive to change root location to "my.project" with this:

Code:
DocumentRoot "/var/www/vhosts/my.project/httpdocs"
<Directory /var/www/vhosts/my.project/httpdocs>
    <IfModule mod_proxy_fcgi.c>
        <Files ~ (\.php$)>
            SetHandler proxy:unix:///var/www/vhosts/system/my.project/php-fpm.sock|fcgi://127.0.0.1:9000
        </Files>
    </IfModule>
</Directory>

I want to enable HTTP/2 but it is not possible on Plesk without Nginx.
So I tried to use Nginx but I can not redefine root location with Nginx directive (not permitted).

With nginx reverse proxy mode, coolsite.com display my.project (this is what I want) but I have got 404 error on CSS, picture or files with rewrite rules in htaccess. Like root was not good... I hope you understand...

As far as I need real email account on coolsite.com, I can not use domain alias.
Do you have any idea on how to achieve this?

HTTP/2 with Apache would be perfect but it is not possible on Plesk...

Thanks.
Lrnt.
 
Why not just...point my project to plesk, or put the my.project files in coolsite's folder?
 
Why not just...point my project to plesk, or put the my.project files in coolsite's folder?
Sorry, I don't understand "point my project to plesk".

I can not put files in coolsite.com folder because my.project can be used with several domains and a detection according the domain is done to load files and database.

I really need to change root location in nginx like do with apache directive (this is working). Or another method to have domain alias and real email account.
 
In that case, just add it as a normal domain and have them share a doc root. This can be set in Plesk as long as they are part of the same subscription
 
In that case, just add it as a normal domain and have them share a doc root. This can be set in Plesk as long as they are part of the same subscription
Really? Why I didn't know that? I need to investigate... I did not that different domain can share a doc root... o_O

Here is a picture of what I need (which works with apache directive and nginx disable) and, so, no http2 :
my.projet.jpg
 
@john0001 Multiple domains, same subscription, same root location seems to work. Thank you! Just need to try with nginx on to have HTTP/2

Do you know how to move a domain from a subscription to another subscription (without losing email account)?
 
Hi!
  • Removing Apache directives to change root location: OK
  • Domains in same subscription to use same PHP scripts by changing document root in domain parameters: OK
  • Enable NGINX to get HTTP/2: OK
All is ok. Solved.
 
Back
Top