Guest User

Untitled

a guest
Aug 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. *.example.com -> 1.2.3.4
  2. *.anotherexample.com -> 1.2.3.4
  3.  
  4. server {
  5.  
  6. listen 80;
  7.  
  8. server_name
  9. example.com
  10. www.example.com
  11. *.example.com;
  12.  
  13. location /.well-known {
  14. alias /var/www/html/letsencrypt;
  15. }
  16.  
  17. location / {
  18.  
  19. proxy_pass_header Authorization;
  20. proxy_pass http://address.of-the.internal.example-webserver
  21. proxy_set_header Host $host;
  22. proxy_set_header X-Real-IP $remote_addr;
  23. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  24. proxy_http_version 1.1;
  25. proxy_set_header Connection "";
  26. proxy_buffering off;
  27. client_max_body_size 0;
  28. proxy_read_timeout 36000s;
  29. proxy_redirect off;
  30. access_log /var/log/nginx/example.com.log;
  31. error_log /var/log/nginx/example.com.log error;
  32.  
  33. }
  34. }
  35.  
  36. server {
  37.  
  38. listen 80;
  39.  
  40. server_name
  41. anotherexample.com
  42. www.anotherexample.com
  43. *.anotherexample.com;
  44.  
  45. location /.well-known {
  46. alias /var/www/html/letsencrypt;
  47. }
  48.  
  49. location / {
  50.  
  51. proxy_pass_header Authorization;
  52. proxy_pass http://address.of-the.internal.anotherexample-webserver
  53. proxy_set_header Host $host;
  54. proxy_set_header X-Real-IP $remote_addr;
  55. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  56. proxy_http_version 1.1;
  57. proxy_set_header Connection "";
  58. proxy_buffering off;
  59. client_max_body_size 0;
  60. proxy_read_timeout 36000s;
  61. proxy_redirect off;
  62. access_log /var/log/nginx/anotherexample.com.log;
  63. error_log /var/log/nginx/anotherexample.com.log error;
  64.  
  65. }
  66. }
  67.  
  68. server {
  69.  
  70. listen 80;
  71.  
  72. server_name application1.example.com;
  73.  
  74. location / {
  75.  
  76. proxy_pass_header Authorization;
  77. proxy_pass http://internal.address.of-example-app-one
  78. proxy_set_header Host $host;
  79. proxy_set_header X-Real-IP $remote_addr;
  80. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  81. proxy_http_version 1.1;
  82. proxy_set_header Connection "";
  83. proxy_buffering off;
  84. client_max_body_size 0;
  85. proxy_read_timeout 36000s;
  86. proxy_redirect off;
  87. access_log /var/log/nginx/exampleappone.access.log;
  88. error_log /var/log/nginx/exampleappone.error.log error;
  89.  
  90. }
  91. }
  92.  
  93. server {
  94.  
  95. listen 80;
  96.  
  97. server_name application2.example.com;
  98.  
  99. location / {
  100.  
  101. proxy_pass_header Authorization;
  102. proxy_pass http://internal.address.of-example-app-two
  103. proxy_set_header Host $host;
  104. proxy_set_header X-Real-IP $remote_addr;
  105. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  106. proxy_http_version 1.1;
  107. proxy_set_header Connection "";
  108. proxy_buffering off;
  109. client_max_body_size 0;
  110. proxy_read_timeout 36000s;
  111. proxy_redirect off;
  112. access_log /var/log/nginx/exampleapptwo.access.log;
  113. error_log /var/log/nginx/exampleapptwo.error.log error;
  114.  
  115. }
  116. }
  117.  
  118. server {
  119.  
  120. listen 80;
  121.  
  122. server_name application1.anotherexample.com;
  123.  
  124. location / {
  125.  
  126. proxy_pass_header Authorization;
  127. proxy_pass http://internal.address.of-anotherexample-app-one
  128. proxy_set_header Host $host;
  129. proxy_set_header X-Real-IP $remote_addr;
  130. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  131. proxy_http_version 1.1;
  132. proxy_set_header Connection "";
  133. proxy_buffering off;
  134. client_max_body_size 0;
  135. proxy_read_timeout 36000s;
  136. proxy_redirect off;
  137. access_log /var/log/nginx/anotherexampleappone.access.log;
  138. error_log /var/log/nginx/anotherexampleappone.error.log error;
  139.  
  140. }
  141. }
Add Comment
Please, Sign In to add comment