Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # https://www.nginx.com/resources/wiki/start/
  5. # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
  6. # https://wiki.debian.org/Nginx/DirectoryStructure
  7. #
  8. # In most cases, administrators will remove this file from sites-enabled/ and
  9. # leave it as reference inside of sites-available where it will continue to be
  10. # updated by the nginx packaging team.
  11. #
  12. # This file will automatically load configuration files provided by other
  13. # applications, such as Drupal or Wordpress. These applications will be made
  14. # available underneath a path with that package name, such as /drupal8.
  15. #
  16. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  17. ##
  18.  
  19. # Default server configuration
  20. #
  21. server {
  22. listen 80 default_server;
  23. listen [::]:80 default_server;
  24.  
  25. # SSL configuration
  26. #
  27. # listen 443 ssl default_server;
  28. # listen [::]:443 ssl default_server;
  29. #
  30. # Note: You should disable gzip for SSL traffic.
  31. # See: https://bugs.debian.org/773332
  32. #
  33. # Read up on ssl_ciphers to ensure a secure configuration.
  34. # See: https://bugs.debian.org/765782
  35. #
  36. # Self signed certs generated by the ssl-cert package
  37. # Don't use them in a production server!
  38. #
  39. # include snippets/snakeoil.conf;
  40.  
  41. root /var/www/html;
  42.  
  43. # Add index.php to the list if you are using PHP
  44. index index.html index.htm index.nginx-debian.html;
  45.  
  46. server_name _;
  47.  
  48. location / {
  49. # First attempt to serve request as file, then
  50. # as directory, then fall back to displaying a 404.
  51. try_files $uri $uri/ =404;
  52. }
  53.  
  54. # pass PHP scripts to FastCGI server
  55. #
  56. #location ~ \.php$ {
  57. # include snippets/fastcgi-php.conf;
  58. #
  59. # # With php-fpm (or other unix sockets):
  60. # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  61. # # With php-cgi (or other tcp sockets):
  62. # fastcgi_pass 127.0.0.1:9000;
  63. #}
  64.  
  65. # deny access to .htaccess files, if Apache's document root
  66. # concurs with nginx's one
  67. #
  68. #location ~ /\.ht {
  69. # deny all;
  70. #}
  71. }
  72.  
  73.  
  74. # Virtual Host configuration for example.com
  75. #
  76. # You can move that to a different file under sites-available/ and symlink that
  77. # to sites-enabled/ to enable it.
  78. #
  79. #server {
  80. # listen 80;
  81. # listen [::]:80;
  82. #
  83. # server_name example.com;
  84. #
  85. # root /var/www/example.com;
  86. # index index.html;
  87. #
  88. # location / {
  89. # try_files $uri $uri/ =404;
  90. # }
  91. #}
  92.  
  93. server {
  94. listen 80;
  95. server_name reverse.krunt.io;
  96. location ~ /(.*) {
  97. proxy_pass http://127.0.0.1:$1;
  98. proxy_http_version 1.1;
  99. proxy_set_header Upgrade $http_upgrade;
  100. proxy_set_header Connection "Upgrade";
  101. }
  102. }
  103.  
  104. server {
  105. listen 80;
  106. server_name reverse.krunt.io;
  107. location ~ /(.*) {
  108. proxy_pass http://127.0.0.1:$1;
  109. proxy_http_version 1.1;
  110. proxy_set_header Upgrade $http_upgrade;
  111. proxy_set_header Connection "Upgrade";
  112. }
  113. }
  114.  
  115.  
  116. server {
  117. listen 80;
  118. server_name kize.io;
  119. location ~ /(.*) {
  120. proxy_pass http://127.0.0.1:22714;
  121. }
  122. }
  123.  
  124.  
  125. server {
  126. listen 80;
  127. server_name blog.krunt.io;
  128. root /var/www/html/blog;
  129. }
  130.  
  131. server {
  132. listen 2567;
  133. add_header Access-Control-Allow-Origin '*' always;
  134. server_name schooltest.krunt.io;
  135. root /var/www/html/;
  136. }
  137.  
  138. server {
  139. listen 80;
  140. server_name www.krunt.io;
  141. return 301 $scheme://krunt.io$request_uri;
  142. }
  143.  
  144. server {
  145. listen 80;
  146.  
  147. server_name forum.krunt.io;
  148.  
  149. location / {
  150. proxy_set_header X-Real-IP $remote_addr;
  151. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  152. proxy_set_header X-Forwarded-Proto $scheme;
  153. proxy_set_header Host $http_host;
  154. proxy_set_header X-NginX-Proxy true;
  155.  
  156. proxy_pass http://io_nodes;
  157. proxy_redirect off;
  158.  
  159. # Socket.IO Support
  160. proxy_http_version 1.1;
  161. proxy_set_header Upgrade $http_upgrade;
  162. proxy_set_header Connection "upgrade";
  163. }
  164. }
  165.  
  166. upstream io_nodes {
  167. ip_hash;
  168. server 127.0.0.1:4567;
  169. server 127.0.0.1:4568;
  170. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement