• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • 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.

Nginx Wildcard subdomain problem

Observateur

New Pleskian
Hello,

I have a problem with Nginx on myPlesk 12 with wildcard dns.

I want subdomains URl to be like root domain url. Exemple

http://*.domain.com/folder/folder/fileredirect to
http://www.domain.com/folder/folder/fileredirect to

You can see a live exemple here: http://bultraland.kouaa-blog.com/ CSS files (http://bultraland.kouaa-blog.com/templates/reic/reic.css) give error 404 instead of showing root domain file (http://www.kouaa-blog.com/templates/reic/reic.css). It's the same for images.

What specific rule I must add in plesk panel?
 
klyde,

In order to disable Nginx for a domain, admin should un-check (turn off) three settings below:
Websites & Domains > DOMAIN.TLD > Web Server Settings for DOMAIN.TLD
[ ] Smart static files processing
[ ] Serve static files directly by nginx
[ ] Process PHP by nginx


However, Nginx configs still will be created for the domain and nginx will listen for port 80
 
Last edited:
Observateur,

this can be done using Nginx rewrite rules, as example:
location / {
if ($http_host ~ "^(.*)\.domain\.com"){
rewrite ^(.*)$ http://domain.com/subdomains/%1/$1 redirect;
}
}

Nginx rewrite rules can be added for a website by ADMIN in
Websites & Domains > DOMAIN.TLD > Web Server Settings for DOMAIN.TLD > "Additional nginx directives"
 
Last edited:
klyde,

There is a technical possibility to do this in Plesk - using Nginx rewrite rules.
In order to be sure that Nginx rewrite rules are applied to static files, please check that Nginx serves static files on the website:

Websites & Domains > DOMAIN.TLD > Web Server Settings for DOMAIN.TLD
[*] Serve static files directly by nginx
 
Back
Top