Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. upstream backend {
  2. server speechyard.com:443;
  3. server 127.0.0.1:8000 backup;
  4. }
  5.  
  6. upstream backend_chat {
  7. server speechyard.com:8085;
  8. server 127.0.0.1:8000 backup;
  9. }
  10.  
  11. server {
  12. listen 80 default_server;
  13. listen [::]:80 default_server ipv6only=on;
  14.  
  15. root /var/www/public_html/dummy;
  16. index index.html index.htm;
  17.  
  18. # Make site accessible from http://localhost/
  19. server_name localhost;
  20.  
  21. location / {
  22. # First attempt to serve request as file, then
  23. # as directory, then fall back to displaying a 404.
  24. try_files $uri $uri/ /index.html;
  25. # Uncomment to enable naxsi on this location
  26. # include /etc/nginx/naxsi.rules
  27. }
  28.  
  29. }
  30.  
  31. server {
  32. listen 0.0.0.0:80;
  33.  
  34. root /var/www/public_html/dummy;
  35. index index.html index.htm;
  36.  
  37. server_name speechyard.com;
  38.  
  39. #SSL
  40. listen 0.0.0.0:443;
  41. ssl on;
  42. ssl_certificate /etc/nginx/ssl/public.crt;
  43. ssl_certificate_key /etc/nginx/ssl/private.key;
  44. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  45. access_log /var/log/nginx/dummy.access.log;
  46. error_log /var/log/nginx/dummy.error.log;
  47.  
  48. location / {
  49. proxy_set_header X-Real-IP $remote_addr;
  50. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  51. proxy_set_header Host $host;
  52. proxy_set_header X-NginX-Proxy true;
  53. proxy_set_header X-Forwarded-Proto $scheme;
  54. proxy_set_header HTTPS $https;
  55. proxy_pass https://backend;
  56. proxy_http_version 1.1;
  57. proxy_read_timeout 150;
  58. # First attempt to serve request as file, then
  59. # as directory, then fall back to displaying a 404.
  60. #try_files $uri $uri/ /index.html;
  61. # Uncomment to enable naxsi on this location
  62. # include /etc/nginx/naxsi.rule
  63. }
  64. if ($request_method = "GET" ) {
  65. rewrite ^([^.\?]*[^/])$ $1/ permanent;
  66. }
  67. }
  68.  
  69. server {
  70. listen 0.0.0.0:80;
  71.  
  72. root /var/www/public_html/dummy;
  73. index index.html index.htm;
  74.  
  75. server_name admin.speechyard.com;
  76.  
  77. location / {
  78. proxy_set_header X-Real-IP $remote_addr;
  79. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  80. proxy_set_header Host $host;
  81. proxy_set_header X-NginX-Proxy true;
  82. proxy_pass http://backend;
  83. #proxy_redirect off;
  84. proxy_http_version 1.1;
  85. proxy_read_timeout 150;
  86. # First attempt to serve request as file, then
  87. # as directory, then fall back to displaying a 404.
  88. #try_files $uri $uri/ /index.html;
  89. # Uncomment to enable naxsi on this location
  90. # include /etc/nginx/naxsi.rules
  91. }
  92. }
  93.  
  94. server {
  95. listen 8085;
  96. listen [::]:8085 ipv6only=on;
  97.  
  98. root /var/www/public_html/dummy;
  99. index index.html index.htm;
  100.  
  101. server_name speechyard.com;
  102.  
  103. #SSL
  104. ssl_stapling on;
  105. ssl on;
  106. ssl_certificate /etc/nginx/ssl/public.crt;
  107. ssl_certificate_key /etc/nginx/ssl/private.key;
  108. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  109. access_log /var/log/nginx/chat.access.log;
  110. error_log /var/log/nginx/chat.error.log;
  111.  
  112.  
  113. location / {
  114. proxy_set_header X-Real-IP $remote_addr;
  115. proxy_http_version 1.1;
  116. proxy_set_header Upgrade $http_upgrade;
  117. proxy_set_header Connection "upgrade";
  118. # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  119. proxy_set_header Host $host;
  120. # proxy_set_header X-NginX-Proxy true;
  121. proxy_pass https://backend_chat;
  122. #proxy_redirect off;
  123. proxy_read_timeout 150;
  124. }
  125. }
  126.  
  127.  
  128. # another virtual host using mix of IP-, name-, and port-based configuration
  129. #
  130. server {
  131. listen 8000;
  132. ssl on;
  133. ssl_certificate /etc/nginx/ssl/public.crt;
  134. ssl_certificate_key /etc/nginx/ssl/private.key;
  135. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  136.  
  137. root /var/www/public_html/dummy;
  138.  
  139. index index.html index.htm;
  140.  
  141. location / {
  142. try_files $uri $uri/ /index.html;
  143. }
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement