#1  
Old 11th May 2012, 13:27
sumfvm sumfvm is offline
HowtoForge Supporter
 
Join Date: Sep 2011
Location: Strasbourg, France
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default Apache2 to Apache2 + Nginx

Hi all,

I follow this guide: http://www.howtoforge.com/nginx-catc...n-debian-lenny

All is working perfectly for all customers who own a subdomain like user.my-domain.com but for those owning their own domain name, they are redirected to their-domain.com and www.their-domain.com don't work anymore, not fully, the files like .css and .js aren't found (nginx's logs showing that nginx try to find /var/www/www.domain.com instead of /var/www/domain.com).

I think it is because this Nginx directive:
Code:
#### www. redirect	- all domains starting with www will be redirected to http://domain. ####
    if ($host ~* ^(www\.)(.+)) {
        set $rawdomain $2;
        rewrite ^/(.*)$  http://$rawdomain/$1 permanent;
    }
In fact, I don't understand the presence of it...

Any idea?

Regards,
Reply With Quote
Sponsored Links
  #2  
Old 12th May 2012, 11:20
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,724 Times in 2,564 Posts
Default

Please hardcode the document root - instead of
Code:
root   /var/www/$host/web;
use
Code:
root   /var/www/domain.com/web;
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
sumfvm (12th May 2012)
  #3  
Old 12th May 2012, 13:15
sumfvm sumfvm is offline
HowtoForge Supporter
 
Join Date: Sep 2011
Location: Strasbourg, France
Posts: 25
Thanks: 2
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by falko View Post
Please hardcode the document root - instead of
Code:
root   /var/www/$host/web;
use
Code:
root   /var/www/domain.com/web;
Thanks for the trick Falko but the problem will stay for all the subdomains, istn't it?
Reply With Quote
  #4  
Old 13th May 2012, 10:31
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,724 Times in 2,564 Posts
 
Default

That's possible. I didn't try the tutorial, but looking at it, I'd say

Code:
root   /var/www/$rawdomain/web;
is the correct solution.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig 3.0.1.4 causes Apache to have too many open files gkovacs Installation/Configuration 29 27th February 2013 08:59
Whole server went down wxman General 25 28th September 2012 18:32
Apache2 high load lano Server Operation 3 24th December 2011 17:29
ISPConfig 3.0.4 - Migrate from Apache2 to nginx maatien General 2 3rd November 2011 13:11
Apache2 alongside lighthttpd or nginx? talkingnews Server Operation 3 22nd May 2011 20:39


All times are GMT +2. The time now is 01:33.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.