How can i rewrite a domain with a port to a subdomain?
e.q.: domain.com:3000
to sub.domain.com
?
thanks for your help! :)
greetz
How can i rewrite a domain with a port to a subdomain?
e.q.: domain.com:3000
to sub.domain.com
?
thanks for your help! :)
greetz
You could use Passenger in nginx to delivery the Ruby app - that's the method we are currently using.
http://www.modrails.com/
If you actually want to redirect (301 or 302) your web traffic
You create a
server {}
section listening on port 3000 and you just redirect it to anotherserver {}
section that is listening on port 80. In eachserver {}
section set thelisten
property appropriately. I guess you are trying to handle the redirection within à singleserver
section and according to this page thelisten
directive applies to aserver
contextIf you want to use nginx as a proxy
Then what you are looking for is the proxy_pass directive. Here is a sample configuration extracted from an config I have to use nginx as a proxy for my rails app (thin). Basically my app runs locally (but it would also work on a remote host) on port 3200 and the relevant nginx config part looks as follow: