7 |
7 |
proxy_buffers 6 32k;
|
8 |
8 |
proxy_busy_buffers_size 32k;
|
9 |
9 |
large_client_header_buffers 8 8k;
|
|
10 |
proxy_ssl_session_reuse off;
|
10 |
11 |
|
11 |
12 |
%if not %%is_empty(%%revprox_default)
|
12 |
13 |
server {
|
... | ... | |
32 |
33 |
%set %%dom_dict={}
|
33 |
34 |
%if %%revprox_activate_http == 'oui'
|
34 |
35 |
%for %%location_iter in %%revprox_domainname
|
35 |
|
%%dom_dict.setdefault(%%location_iter.value, []).append((%%location_iter.revprox_rep, %%location_iter.revprox_http, %%location_iter.revprox_https, %%location_iter.revprox_url))
|
|
36 |
%%dom_dict.setdefault(%%location_iter.value, []).append((%%location_iter.revprox_rep, %%location_iter.revprox_http, %%location_iter.revprox_https, %%location_iter.revprox_url, ''))
|
36 |
37 |
%end for
|
37 |
38 |
%end if % if %%revprox_activate_http == 'oui'
|
38 |
39 |
|
39 |
40 |
%if %%is_defined('web_url') and %%revprox_auto_config_local_web == 'oui'
|
40 |
|
%%dom_dict.setdefault(%%web_url, []).append(('/', 'redirige vers https', 'oui', 'https://'+%%container_ip_web))
|
|
41 |
%%dom_dict.setdefault(%%web_url, []).append(('/', 'redirige vers https', 'oui', 'https://'+%%container_ip_web, ''))
|
|
42 |
%end if
|
|
43 |
|
|
44 |
%if %%revprox_redirection_http == 'oui'
|
|
45 |
%for %%location_iter in %%revprox_redirection
|
|
46 |
%%dom_dict.setdefault(%%location_iter.value, []).append((%%location_iter.revprox_redirection_rep, 'redirige', 'redirige', '', %%location_iter.revprox_destination))
|
|
47 |
%end for
|
41 |
48 |
%end if
|
42 |
49 |
|
43 |
50 |
%set %%rewrite_dict={}
|
... | ... | |
57 |
64 |
location = /nginx.html{
|
58 |
65 |
root /var/www/nginx-default;
|
59 |
66 |
}
|
60 |
|
%for %%rep_iter, %%http_iter, %%https_iter, %%url_iter in %%dom_dict[%%revprox_iter]
|
|
67 |
%for %%rep_iter, %%http_iter, %%https_iter, %%url_iter, %%redirection in %%dom_dict[%%revprox_iter]
|
61 |
68 |
%if %%http_iter == 'non'
|
62 |
69 |
%continue
|
63 |
70 |
%end if
|
... | ... | |
66 |
73 |
%else
|
67 |
74 |
%set %%rep_location = '/'
|
68 |
75 |
%end if
|
|
76 |
%if %%redirection == ""
|
|
77 |
%set %%redirection = "https://$host"
|
|
78 |
%end if
|
69 |
79 |
location %%rep_location {
|
70 |
|
%if %%http_iter == 'redirige vers https'
|
|
80 |
%if %%http_iter in ['redirige vers https', 'redirige']
|
71 |
81 |
if ($host = "%%revprox_iter" ) {
|
72 |
|
rewrite ^(.*) https://$host$1 permanent;
|
|
82 |
%if %%rep_location != '/' and %%http_iter == 'redirige'
|
|
83 |
rewrite ^%%{rep_location}(.*) %%redirection/$1 permanent;
|
|
84 |
%else
|
|
85 |
rewrite ^(.*) %%redirection$1 permanent;
|
|
86 |
%end if
|
73 |
87 |
break;
|
74 |
88 |
}
|
75 |
89 |
%elif %%http_iter == 'oui'
|
... | ... | |
131 |
145 |
tcp_nodelay on;
|
132 |
146 |
}
|
133 |
147 |
%end if
|
134 |
|
%for %%rep_iter, %%http_iter, %%https_iter, %%url_iter in %%dom_dict[%%revprox_iter]
|
|
148 |
%for %%rep_iter, %%http_iter, %%https_iter, %%url_iter, %%redirection in %%dom_dict[%%revprox_iter]
|
135 |
149 |
%if not %%http_iter == 'redirige vers https' and %%https_iter == 'non'
|
136 |
150 |
%continue
|
137 |
151 |
%end if
|
... | ... | |
141 |
155 |
%set %%rep_location = '/'
|
142 |
156 |
%end if
|
143 |
157 |
location %%rep_location {
|
144 |
|
%if %%url_iter != ''
|
|
158 |
%if %%http_iter == 'redirige'
|
|
159 |
if ($host = "%%revprox_iter" ) {
|
|
160 |
%if %%rep_location != '/'
|
|
161 |
rewrite ^%%{rep_location}(.*) %%redirection/$1 permanent;
|
|
162 |
%else
|
|
163 |
rewrite ^(.*) %%redirection$1 permanent;
|
|
164 |
%end if
|
|
165 |
break;
|
|
166 |
}
|
|
167 |
%else
|
|
168 |
%if %%url_iter != ''
|
145 |
169 |
proxy_pass %%url_iter;
|
146 |
|
%else
|
|
170 |
%else
|
147 |
171 |
proxy_pass http://%%location_iter;
|
148 |
|
%end if % if %%url_iter != ''
|
|
172 |
%end if % if %%url_iter != ''
|
149 |
173 |
proxy_set_header Host $host;
|
150 |
174 |
proxy_set_header X-Real-IP $remote_addr;
|
151 |
175 |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
... | ... | |
157 |
181 |
rewrite %%rewrite_regexp %%rewrite_replacement break;
|
158 |
182 |
%end if
|
159 |
183 |
%end for
|
|
184 |
%end if
|
160 |
185 |
index 50x.html;
|
161 |
186 |
root /var/www/nginx-default/;
|
162 |
187 |
}
|