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

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