Guest User

vhosts

a guest
Nov 8th, 2017
540
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. upstream dev-example-master.domain.com-ingress-example.domain.com-service1 {
  2.  
  3.  
  4. server 10.40.163.33:80;
  5. server 10.40.164.2:80;
  6. server 10.40.165.29:80;
  7.  
  8. }
  9. upstream dev-example-master.domain.com-ingress-example.domain.com-service2 {
  10.  
  11.  
  12. server 10.40.163.24:8080;
  13. server 10.40.163.25:8080;
  14. server 10.40.164.10:8080;
  15. server 10.40.165.18:8080;
  16. server 10.40.165.5:8080;
  17.  
  18. }
  19. upstream dev-example-master.domain.com-ingress-example.domain.com-service3 {
  20.  
  21.  
  22. server 10.40.163.22:80;
  23. server 10.40.163.28:80;
  24. server 10.40.163.29:80;
  25. server 10.40.163.36:80;
  26. server 10.40.163.37:80;
  27.  
  28. }
  29.  
  30.  
  31. server {
  32.  
  33. listen 80;
  34.  
  35. listen 443 ssl http2;
  36. ssl_certificate /etc/nginx/secrets/dev-example-https-domain;
  37. ssl_certificate_key /etc/nginx/secrets/dev-example-https-domain;
  38.  
  39.  
  40. set_real_ip_from 103.21.244.0/22;
  41. set_real_ip_from 103.22.200.0/22;
  42. set_real_ip_from 103.31.4.0/22;
  43. set_real_ip_from 104.16.0.0/12;
  44. set_real_ip_from 108.162.192.0/18;
  45. set_real_ip_from 131.0.72.0/22;
  46. set_real_ip_from 141.101.64.0/18;
  47. set_real_ip_from 162.158.0.0/15;
  48. set_real_ip_from 172.64.0.0/13;
  49. set_real_ip_from 173.245.48.0/20;
  50. set_real_ip_from 188.114.96.0/20;
  51. set_real_ip_from 190.93.240.0/20;
  52. set_real_ip_from 197.234.240.0/22;
  53. set_real_ip_from 198.41.128.0/17;
  54. real_ip_header CF-Connecting-IP;
  55.  
  56.  
  57. server_tokens off;
  58.  
  59. server_name example.com;
  60.  
  61.  
  62.  
  63.  
  64. if ($scheme = http) {
  65. return 301 https://$host:443$request_uri;
  66. }
  67.  
  68.  
  69. location /captcha {
  70. proxy_http_version 1.1;
  71.  
  72.  
  73. proxy_redirect off;
  74. proxy_intercept_errors on;
  75. proxy_set_header Connection "";
  76. proxy_set_header X-CF-Visitor $http_cf_visitor;
  77.  
  78.  
  79. proxy_connect_timeout 60s;
  80. proxy_read_timeout 20m;
  81. client_max_body_size 100m;
  82. proxy_set_header Host $host;
  83. proxy_set_header X-Real-IP $remote_addr;
  84. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  85. proxy_set_header X-Forwarded-Host $host;
  86. proxy_set_header X-Forwarded-Port $server_port;
  87. proxy_set_header X-Forwarded-Proto $scheme;
  88.  
  89. proxy_buffering on;
  90.  
  91. proxy_pass http://dev-example-master.domain.com-ingress-example.domain.com-service1;
  92.  
  93. }
  94. location /api-gateway/ {
  95. proxy_http_version 1.1;
  96.  
  97. proxy_set_header Upgrade $http_upgrade;
  98. proxy_set_header Connection $connection_upgrade;
  99.  
  100. proxy_redirect off;
  101. proxy_intercept_errors on;
  102. proxy_set_header Connection "";
  103. proxy_set_header X-CF-Visitor $http_cf_visitor;
  104.  
  105.  
  106. proxy_connect_timeout 60s;
  107. proxy_read_timeout 20m;
  108. client_max_body_size 100m;
  109. proxy_set_header Host $host;
  110. proxy_set_header X-Real-IP $remote_addr;
  111. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  112. proxy_set_header X-Forwarded-Host $host;
  113. proxy_set_header X-Forwarded-Port $server_port;
  114. proxy_set_header X-Forwarded-Proto $scheme;
  115.  
  116. proxy_buffering on;
  117.  
  118. proxy_pass http://dev-example-master.domain.com-ingress-example.domain.com-service2/;
  119.  
  120. }
  121. location / {
  122. proxy_http_version 1.1;
  123.  
  124.  
  125. proxy_redirect off;
  126. proxy_intercept_errors on;
  127. proxy_set_header Connection "";
  128. proxy_set_header X-CF-Visitor $http_cf_visitor;
  129.  
  130.  
  131. proxy_connect_timeout 60s;
  132. proxy_read_timeout 20m;
  133. client_max_body_size 100m;
  134. proxy_set_header Host $host;
  135. proxy_set_header X-Real-IP $remote_addr;
  136. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  137. proxy_set_header X-Forwarded-Host $host;
  138. proxy_set_header X-Forwarded-Port $server_port;
  139. proxy_set_header X-Forwarded-Proto $scheme;
  140.  
  141. proxy_buffering on;
  142.  
  143. proxy_pass http://dev-example-master.domain.com-ingress-example.domain.com-service3;
  144.  
  145. }
  146. }
RAW Paste Data