Hi,
I’m having some troubles trying to catch all anything in the subdomain
and redirect to mydomain.com:8080.
It should be simple but I try somethings but I couldn’t made it work.
Thank you
Hi,
I’m having some troubles trying to catch all anything in the subdomain
and redirect to mydomain.com:8080.
It should be simple but I try somethings but I couldn’t made it work.
Thank you
Try this:
location / {
rewrite .* http://mydomain.com:8080$uri last;
}
Thank You Denis,
It’s strange, If I enter directly on domain.com:8080 I receive an error
(of the Firefox): “The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this
address in a way that will never complete.”
If I enter www.domain.com:8080 I am redirected to domain.com:8080 and I
got that error.
But if I go to anything.domain.com:8080 I receive the “Server not found”
error.
Denis S. Filimonov wrote:
Try this:
location / {
rewrite .* http://mydomain.com:8080$uri last;
}
On Mon, Mar 10, 2008 at 05:48:13PM +0100, Pedro Axl wrote:
But if I go to anything.domain.com:8080 I receive the “Server not found”
error.
server {
listen 8080;
server_name domain.com;
...
}
server {
listen 8080 default;
server_name *.domain.com;
rewrite ^ http://mydomain.com:8080$uri last;
}
I’m not pretty sure what I’m doing, hehe. I have to open a new server
{…} right?
But If I do it when I try to start nginx I receive this error:
Starting nginx: 2008/03/10 14:22:33 [emerg] 17834#0: directive “server”
in /etc/nginx/nginx.conf:81 is not allowed here
Igor S. wrote:
On Mon, Mar 10, 2008 at 05:48:13PM +0100, Pedro Axl wrote:
But if I go to anything.domain.com:8080 I receive the “Server not found”
error.server { listen 8080; server_name domain.com; ... } server { listen 8080 default; server_name *.domain.com; rewrite ^ http://mydomain.com:8080$uri last; }
On Monday 10 March 2008 12:48:13 Pedro Axl wrote:
Thank You Denis,
It’s strange, If I enter directly on domain.com:8080 I receive an error
(of the Firefox): “The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this
address in a way that will never complete.”
Not sure what exactly it means. Could be a redirection loop.
Try wget, its output is more verbose and sensible.
If I enter www.domain.com:8080 I am redirected to domain.com:8080 and I
got that error.But if I go to anything.domain.com:8080 I receive the “Server not found”
error.
Looks like there’s no wildcard DNS record for *.domain.com
Now I think the structure is ok, but I receive another error:
Starting nginx: 2008/03/11 09:21:07 [emerg] 25934#0: first server name
“*.domain.com” must not be wildcard in /etc/nginx/nginx.conf:145
Igor S. wrote:
On Mon, Mar 10, 2008 at 06:17:15PM +0100, Pedro Axl wrote:
I’m not pretty sure what I’m doing, hehe. I have to open a new server
{…} right?But If I do it when I try to start nginx I receive this error:
Starting nginx: 2008/03/10 14:22:33 [emerg] 17834#0: directive “server”
in /etc/nginx/nginx.conf:81 is not allowed hereYou configuraiton file should have the following structure:
http {
server { location ... { } location ... { } location ... { } } server { }
You did not close some bracket.
On Mon, Mar 10, 2008 at 06:17:15PM +0100, Pedro Axl wrote:
I’m not pretty sure what I’m doing, hehe. I have to open a new server
{…} right?But If I do it when I try to start nginx I receive this error:
Starting nginx: 2008/03/10 14:22:33 [emerg] 17834#0: directive “server”
in /etc/nginx/nginx.conf:81 is not allowed here
You configuraiton file should have the following structure:
http {
server {
location ... {
}
location ... {
}
location ... {
}
}
server {
}
You did not close some bracket.
On Tue, Mar 11, 2008 at 01:19:49PM +0100, Pedro Axl wrote:
Now I think the structure is ok, but I receive another error:
Starting nginx: 2008/03/11 09:21:07 [emerg] 25934#0: first server name
“*.domain.com” must not be wildcard in /etc/nginx/nginx.conf:145
The first name in server_name could be wildcard since 0.6.25 only.
In early verisons use
server_name www.domain.com *.domain.com;
Pedro Axl wrote:
I’m not pretty sure what I’m doing, hehe. I have to open a new server
location … {}
You did not close some bracket.
(.*.)?.domain.com
On Tue, Mar 11, 2008 at 08:37:24PM +0800, Cherife Li wrote:
server { server { }
You did not close some bracket.
(.*.)?.domain.com
No.
First, in this version regex can not be first name too.
Second, .domain.com is not valid name.
Third, domain.com shoule be handled in another server.
Hi,
Something strange is happening. I try all things you have suggested, and
try exacly the example that’s in nginx wiki
(http://wiki.codemongers.com/NginxVirtualHostExample) and I simply can’t
make things work.
Is there anything I have to do in the DNS records or something like?
Cherife Li wrote:
Igor S. wrote:
On Tue, Mar 11, 2008 at 08:37:24PM +0800, Cherife Li wrote:
(.*.)?.domain.com
No.
First, in this version regex can not be first name too.
Second, .domain.com is not valid name.
Oh, yeah, I meant (.*.)?domain.com.
Third, domain.com should be handled in another server.
Got it.Sorry, Pedro.
Igor S. wrote:
On Tue, Mar 11, 2008 at 08:37:24PM +0800, Cherife Li wrote:
(.*.)?.domain.com
No.
First, in this version regex can not be first name too.
Second, .domain.com is not valid name.
Oh, yeah, I meant (.*.)?domain.com.
Third, domain.com should be handled in another server.
Got it.
Sorry, Pedro.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs