Welcome! Log In Create A New Profile

Advanced

proxy_set_header by subdomain

Posted by teena 
proxy_set_header by subdomain
March 12, 2010 04:27AM
Hi,

is it possible to use
proxy_set_header

for a special subdomain within a normal "match-all" server-directive?
I want to set special informations in the Request header to say my server please serve in english (in this example)
and i want to set any language for any subdomain as i want so it would be cool to to this in the ngix-configuration.

but nginx says ""proxy_set_header" directive is not allowed here"

Example:

server {

listen 80;

#ADD LANGUAGE FLAGS TO SUBDOMAINS
if ($http_host ~* "it.mydomain.de") {
proxy_set_header vd-transl-lang en;
}


#many location..and so on rules
# RULESRULES
}


OR

is it possible to extract #RULESRULES to an seperate "i dont know.. class?" and do something like this:



#special
server {

listen 80;
server_name it.domain.de;

proxy_set_header vd-transl-lang en;

INCLUDE rules;
}

#all other
server {

listen 80;
server_name domain.de;

INCLUDE rules;
}


rules {
#many location..and so on rules
# RULESRULES
}



Edited 1 time(s). Last edit at 03/12/2010 04:28AM by teena.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 285
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