• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

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