Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 11th December 2010, 12:34
bzzik bzzik is offline
Join Date: Aug 2008
Posts: 67
Thanks: 1
Thanked 2 Times in 2 Posts
Default nginx + ISPConfig2 + subdomain sites = problem

Hi guys!

I followed this tutorial to install nginx. It works nice for domains, which begins with www. Cause in this tutorial we point the root to /var/www/www.$host/web. But I have some sites, which are available in subdomains, so the root for this sites is /var/www/subdomain.$host/web.

I am not so good in all these "rewrite things", so what should I change in nginx.conf to make this sites work?

Thank you!

Why we should use this in nginx.conf?

if ($host ~* ^(www\.)(.+)) {
set $rawdomain $2;
rewrite ^/(.*)$ http://$rawdomain/$1 permanent;

if (-d $request_filename) {
rewrite ^/(.+[^/])$ http://$host/$1/ permanent;
Reply With Quote
Sponsored Links
Old 11th December 2010, 16:23
bzzik bzzik is offline
Join Date: Aug 2008
Posts: 67
Thanks: 1
Thanked 2 Times in 2 Posts

So at the moment the solution I have is to remove www in the root path so it looks like /var/www/$host/web. But, now the problem is that site is not accessible, if I am using it's address without www. The only thing I can do is to make manually the symlink like domain.com pointing to root folder of this web.
Reply With Quote


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
postfix problems with smtp linkdeb Server Operation 13 15th March 2014 18:58
Mail send/recieve problem DKLeader Installation/Configuration 14 22nd February 2011 16:13
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 13:20
subdomain problem drakos Installation/Configuration 3 25th February 2006 11:24
problem for accessing created sites ericli Server Operation 1 26th November 2005 10:47

All times are GMT +2. The time now is 15:25.

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