Nginx for static and $host
I use Nginx Catch-All Host As Front End To Apache (for my static files) :
In my panel, i set up my website with auto subdomain "www". So with this line "root /var/www/$host/web;" in /etc/nginx/sites-available/default it's returns a 404 error for the static files on my websites. Is normal because $host = www.mydomain.com and ispconfig is configure for mydomain.com
If i replace manualy $host by mydomain.com, it works. However, I 've several websites.
The solution would be to rename the $host variable into /etc/nginx/sites-available/default, but is that possible? Such as php $host = str_replace('.www', '', $host);
Thanks ! (again :()
You could simply create a vhost for example.com and redirect it to the www.example.com vhost:
But this rules doesn't work for me (redirect loop error)
However, I'm inspired by your idea and I just created a virtual host like this www.domain.tld in /etc/nginx/sites-enabled/
In this file, I wrote :
Voilą ! :D
|All times are GMT +2. The time now is 21:35.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.