Welcome! Log In Create A New Profile

Advanced

Re: Nginx redirect domain and sub-domain without www

Francis Daly
February 19, 2013 06:22PM
On Tue, Feb 19, 2013 at 04:54:46PM -0500, la_chouette wrote:

Hi there,

> for saas web application project I need to redirect subdomains to a specific
> directory (app-saas /) without the www.
>
> The domain name must also be without redirecting to the www root.

I'm afraid that I don't understand what exactly you are asking for.

When someone asks for http://www.example.com/file, what do you want to
send back? The contents of /usr/local/nginx/html/file? Or tell them to
ask for http://example.com/file instead? Or something else?

Same question for http://www.sub.example.com/file --
contents of /usr/local/nginx/html/app-saas/file; redirect to
http://sub.example.com/file; something else?

And is that "for any subdomain they use", or "for one specific one"?

> f possible I would like to assemble her two redirect rules in a single
> parenthesis "server {...}" to apply to all common filters (header expire,
> deny, Hotlink, etc.)

If the configuration really is common, then using "include" might be an
option. But the earlier questions are probably more useful to answer first.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx redirect domain and sub-domain without www

la_chouette February 19, 2013 04:54PM

Re: Nginx redirect domain and sub-domain without www

Francis Daly February 19, 2013 06:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 256
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready