test.site (11168B)
1 server { 2 listen 80; 3 listen [::]:80; 4 server_name test.taler.net 5 bank.test.taler.net 6 shop.test.taler.net 7 donations.test.taler.net 8 survey.test.taler.net 9 auditor.test.taler.net 10 exchange.test.taler.net 11 backoffice.test.taler.net; 12 13 # 301-based ridirects allows the user agent to *change* the 14 # method used in the second request. This breaks all the API 15 # using POST, as some user agents do the second request using 16 # GET. 307 is meant to tell the user agent to not change the 17 # method in the second request. 18 if ($request_method = POST) { return 307 https://$host$request_uri; } 19 return 301 https://$host$request_uri; 20 } 21 22 server { 23 server_name test.taler.net www.test.taler.net; 24 listen 443 ssl; 25 listen [::]:443 ssl; 26 rewrite /javascript /javascript.html break; 27 include conf.d/talerssl; 28 location @green { 29 add_header X-Taler-Deployment-Color green; 30 root /home/test-green/landing/demo; 31 } 32 location @blue { 33 add_header X-Taler-Deployment-Color blue; 34 root /home/test-blue/landing/demo; 35 } 36 location / { 37 # Redirection technique explainted at 38 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 39 error_page 418 = @blue; 40 error_page 419 = @green; 41 rewrite ^/$ /en/ redirect; 42 rewrite ^/(..)/$ /$1/index.html break; 43 recursive_error_pages on; 44 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 45 if ($http_x_taler_deployment_color ~ "green") { return 419; } 46 root /home/test/landing/demo; 47 } 48 include conf.d/favicon_robots; 49 } 50 51 52 server { 53 server_name auditor.test.taler.net; 54 listen 443 ssl; 55 listen [::]:443 ssl; 56 root /dev/null; 57 include conf.d/talerssl; 58 location @green { 59 add_header X-Taler-Deployment-Color green; 60 root /home/test-green/auditor; 61 } 62 location @blue { 63 add_header X-Taler-Deployment-Color blue; 64 root /home/test-blue/auditor; 65 } 66 location / { 67 # Redirection technique explainted at 68 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 69 error_page 418 = @blue; 70 error_page 419 = @green; 71 rewrite ^/$ /en/ redirect; 72 rewrite ^/(..)/$ /$1/index.html break; 73 recursive_error_pages on; 74 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 75 if ($http_x_taler_deployment_color ~ "green") { return 419; } 76 root /home/test/auditor; 77 } 78 include conf.d/favicon_robots; 79 } 80 81 82 server { 83 server_name exchange.test.taler.net; 84 listen 443 ssl; 85 listen [::]:443 ssl; 86 root /dev/null; 87 include conf.d/talerssl; 88 location @blue-admin { 89 add_header X-Taler-Deployment-Color blue; 90 proxy_pass http://unix:/home/test-blue/sockets/exchange-admin.http; 91 proxy_redirect off; 92 proxy_set_header Host $host; 93 } 94 location @green-admin { 95 add_header X-Taler-Deployment-Color green; 96 proxy_pass http://unix:/home/test-green/sockets/exchange-admin.http; 97 proxy_redirect off; 98 proxy_set_header Host $host; 99 } 100 101 location @blue { 102 add_header X-Taler-Deployment-Color blue; 103 proxy_pass http://unix:/home/test-blue/sockets/exchange.http; 104 proxy_redirect off; 105 proxy_set_header Host $host; 106 } 107 108 location @green { 109 add_header X-Taler-Deployment-Color green; 110 proxy_pass http://unix:/home/test-green/sockets/exchange.http; 111 proxy_redirect off; 112 proxy_set_header Host $host; 113 } 114 115 location /admin { 116 error_page 418 = @blue-admin; 117 error_page 419 = @green-admin; 118 recursive_error_pages on; 119 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 120 if ($http_x_taler_deployment_color ~ "green") { return 419; } 121 proxy_pass http://unix:/home/test/sockets/exchange-admin.http; 122 proxy_redirect off; 123 proxy_set_header Host $host; 124 } 125 126 location / { 127 error_page 418 = @blue; 128 error_page 419 = @green; 129 recursive_error_pages on; 130 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 131 if ($http_x_taler_deployment_color ~ "green") { return 419; } 132 proxy_pass http://unix:/home/test/sockets/exchange.http:/; 133 proxy_redirect off; 134 proxy_set_header Host $host; 135 } 136 } 137 138 139 server { 140 server_name shop.test.taler.net; 141 listen 443 ssl; 142 listen [::]:443 ssl; 143 root /dev/null; 144 include conf.d/talerssl; 145 146 location @blue { 147 add_header X-Taler-Deployment-Color blue; 148 uwsgi_pass unix:/home/test-blue/sockets/shop.uwsgi; 149 include /etc/nginx/uwsgi_params; 150 } 151 location @green { 152 add_header X-Taler-Deployment-Color green; 153 uwsgi_pass unix:/home/test-green/sockets/shop.uwsgi; 154 include /etc/nginx/uwsgi_params; 155 } 156 157 location / { 158 # Redirection technique explainted at 159 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 160 error_page 418 = @blue; 161 error_page 419 = @green; 162 recursive_error_pages on; 163 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 164 if ($http_x_taler_deployment_color ~ "green") { return 419; } 165 uwsgi_pass unix:/home/test/sockets/shop.uwsgi; 166 include /etc/nginx/uwsgi_params; 167 } 168 169 include conf.d/favicon_robots; 170 } 171 172 173 server { 174 server_name playground.test.taler.net; 175 listen 443 ssl; 176 listen [::]:443 ssl; 177 root /dev/null; 178 include conf.d/talerssl; 179 180 location @blue { 181 add_header X-Taler-Deployment-Color blue; 182 uwsgi_pass unix:/home/test-blue/sockets/playground.uwsgi; 183 include /etc/nginx/uwsgi_params; 184 } 185 location @green { 186 add_header X-Taler-Deployment-Color green; 187 uwsgi_pass unix:/home/test-green/sockets/playground.uwsgi; 188 include /etc/nginx/uwsgi_params; 189 } 190 191 location / { 192 # Redirection technique explainted at 193 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 194 error_page 418 = @blue; 195 error_page 419 = @green; 196 recursive_error_pages on; 197 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 198 if ($http_x_taler_deployment_color ~ "green") { return 419; } 199 uwsgi_pass unix:/home/test/sockets/playground.uwsgi; 200 include /etc/nginx/uwsgi_params; 201 } 202 203 include conf.d/favicon_robots; 204 } 205 206 207 server { 208 server_name backend.test.taler.net; 209 listen 443 ssl; 210 listen 80; 211 listen [::]:443 ssl; 212 listen [::]:80; 213 include conf.d/talerssl; 214 215 location @blue { 216 add_header X-Taler-Deployment-Color blue; 217 proxy_pass http://unix:/home/test-blue/sockets/merchant.http; 218 proxy_redirect off; 219 proxy_set_header Host $host; 220 proxy_set_header X-Forwarded-Host "backend.test.taler.net"; 221 proxy_set_header X-Forwarded-Proto "https"; 222 } 223 location @green { 224 add_header X-Taler-Deployment-Color green; 225 proxy_pass http://unix:/home/test-green/sockets/merchant.http; 226 proxy_redirect off; 227 proxy_set_header Host $host; 228 proxy_set_header X-Forwarded-Host "backend.test.taler.net"; 229 proxy_set_header X-Forwarded-Proto "https"; 230 } 231 232 location /public { 233 # Redirection technique explainted at 234 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 235 error_page 418 = @blue; 236 error_page 419 = @green; 237 recursive_error_pages on; 238 239 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 240 if ($http_x_taler_deployment_color ~ "green") { return 419; } 241 proxy_set_header X-Forwarded-Host "backend.test.taler.net"; 242 proxy_set_header X-Forwarded-Proto "https"; 243 proxy_pass http://unix:/home/test/sockets/merchant.http:/public; 244 proxy_redirect off; 245 proxy_set_header Host $host; 246 } 247 248 location / { 249 # Redirection technique explainted at 250 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 251 error_page 418 = @blue; 252 error_page 419 = @green; 253 recursive_error_pages on; 254 255 # match the ApiKey part ignoring case, and the actual key 256 # with case-sensitivity on. 257 if ($http_authorization !~ "(?i)ApiKey (?-i)sandbox") { 258 return 401; 259 } 260 261 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 262 if ($http_x_taler_deployment_color ~ "green") { return 419; } 263 proxy_set_header X-Forwarded-Host "backend.test.taler.net"; 264 proxy_set_header X-Forwarded-Proto "https"; 265 proxy_pass http://unix:/home/test/sockets/merchant.http:/; 266 proxy_redirect off; 267 proxy_set_header Host $host; 268 } 269 } 270 271 272 server { 273 server_name survey.test.taler.net; 274 listen 443 ssl; 275 listen [::]:443 ssl; 276 include conf.d/talerssl; 277 278 location / { 279 uwsgi_pass unix:/home/test/sockets/survey.uwsgi; 280 include /etc/nginx/uwsgi_params; 281 } 282 } 283 284 server { 285 server_name donations.test.taler.net; 286 listen 443 ssl; 287 listen [::]:443 ssl; 288 include conf.d/talerssl; 289 290 location @blue { 291 add_header X-Taler-Deployment-Color blue; 292 uwsgi_pass unix:/home/test-blue/sockets/donations.uwsgi; 293 include /etc/nginx/uwsgi_params; 294 } 295 location @green { 296 add_header X-Taler-Deployment-Color green; 297 uwsgi_pass unix:/home/test-green/sockets/donations.uwsgi; 298 include /etc/nginx/uwsgi_params; 299 } 300 301 location / { 302 # Redirection technique explainted at 303 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 304 error_page 418 = @blue; 305 error_page 419 = @green; 306 recursive_error_pages on; 307 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 308 if ($http_x_taler_deployment_color ~ "green") { return 419; } 309 uwsgi_pass unix:/home/test/sockets/donations.uwsgi; 310 include /etc/nginx/uwsgi_params; 311 } 312 313 include conf.d/favicon_robots; 314 } 315 316 317 server { 318 server_name bank.test.taler.net; 319 listen 443 ssl; 320 listen [::]:443 ssl; 321 include conf.d/talerssl; 322 323 location @blue { 324 add_header X-Taler-Deployment-Color blue; 325 uwsgi_pass unix:/home/test-blue/sockets/bank.uwsgi; 326 include /etc/nginx/uwsgi_params; 327 } 328 location @green { 329 add_header X-Taler-Deployment-Color green; 330 uwsgi_pass unix:/home/test-green/sockets/bank.uwsgi; 331 include /etc/nginx/uwsgi_params; 332 } 333 334 location / { 335 # Redirection technique explainted at 336 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 337 error_page 418 = @blue; 338 error_page 419 = @green; 339 recursive_error_pages on; 340 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 341 if ($http_x_taler_deployment_color ~ "green") { return 419; } 342 uwsgi_pass unix:/home/test/sockets/bank.uwsgi; 343 include /etc/nginx/uwsgi_params; 344 } 345 346 include conf.d/favicon_robots; 347 } 348 349 server { 350 server_name backoffice.test.taler.net; 351 listen 443 ssl; 352 listen [::]:443 ssl; 353 include conf.d/talerssl; 354 355 location @blue { 356 add_header X-Taler-Deployment-Color blue; 357 uwsgi_pass unix:/home/test-blue/sockets/backoffice.uwsgi; 358 include /etc/nginx/uwsgi_params; 359 } 360 location @green { 361 add_header X-Taler-Deployment-Color green; 362 uwsgi_pass unix:/home/test-green/sockets/backoffice.uwsgi; 363 include /etc/nginx/uwsgi_params; 364 } 365 366 location / { 367 # Redirection technique explainted at 368 # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ 369 error_page 418 = @blue; 370 error_page 419 = @green; 371 recursive_error_pages on; 372 if ($http_x_taler_deployment_color ~ "blue") { return 418; } 373 if ($http_x_taler_deployment_color ~ "green") { return 419; } 374 uwsgi_pass unix:/home/test/sockets/backoffice.uwsgi; 375 include /etc/nginx/uwsgi_params; 376 } 377 378 include conf.d/favicon_robots; 379 }