Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 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. #
  5. # Generally, you will want to move this file somewhere, and start with a clean
  6. # file but keep this around for reference. Or just disable in sites-enabled.
  7. #
  8. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  9. ##
  10.  
  11. # Default server configuration
  12. #
  13. server {
  14. listen 80 default_server;
  15. listen [::]:80 default_server;
  16.  
  17. # SSL configuration
  18. #
  19. # listen 443 ssl default_server;
  20. # listen [::]:443 ssl default_server;
  21. #
  22. # Self signed certs generated by the ssl-cert package
  23. # Don't use them in a production server!
  24. #
  25. # include snippets/snakeoil.conf;
  26.  
  27. root /usr/share/nginx/html;
  28.  
  29. # Add index.php to the list if you are using PHP
  30. index index.php index.html index.htm php.info index.nginx-debian.html;
  31.  
  32. server_name _;
  33. include hhvm.conf;
  34.  
  35. location / {
  36. # First attempt to serve request as file, then
  37. # as directory, then fall back to displaying a 404.
  38. try_files $uri $uri/ =404;
  39. }
  40.  
  41. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  42. #
  43. #location ~ .php$ {
  44. # include snippets/fastcgi-php.conf;
  45. #
  46. # # With php7.0-cgi alone:
  47. # fastcgi_pass 127.0.0.1:9000;
  48. # # With php7.0-fpm:
  49. # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  50. #}
  51.  
  52. # deny access to .htaccess files, if Apache's document root
  53. # concurs with nginx's one
  54. #
  55. #location ~ /.ht {
  56. # deny all;
  57. #}
  58. }
  59.  
  60.  
  61. # Virtual Host configuration for example.com
  62. #
  63. # You can move that to a different file under sites-available/ and symlink that
  64. # to sites-enabled/ to enable it.
  65. #
  66. #server {
  67. # listen 80;
  68. # listen [::]:80;
  69. #
  70. # server_name example.com;
  71. #
  72. # root /usr/share/nginx/html/example.com;
  73. # index index.php index.html index.htm index.nginx-debian.html;
  74. #
  75. # location / {
  76. # try_files $uri $uri/ =404;
  77. # }
  78. #}
  79.  
  80. user www-data;
  81. worker_processes auto;
  82. pid /run/nginx.pid;
  83.  
  84. events {
  85. worker_connections 768;
  86. # multi_accept on;
  87. }
  88.  
  89. http {
  90.  
  91. ##
  92. # Basic Settings
  93. ##
  94.  
  95. sendfile on;
  96. tcp_nopush on;
  97. tcp_nodelay on;
  98. keepalive_timeout 65;
  99. types_hash_max_size 2048;
  100. # server_tokens off;
  101.  
  102. # server_names_hash_bucket_size 64;
  103. # server_name_in_redirect off;
  104.  
  105. include /etc/nginx/mime.types;
  106. default_type application/octet-stream;
  107.  
  108. ##
  109. # SSL Settings
  110. ##
  111.  
  112. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  113. ssl_prefer_server_ciphers on;
  114.  
  115. ##
  116. # Logging Settings
  117. ##
  118.  
  119. access_log /var/log/nginx/access.log;
  120. error_log /var/log/nginx/error.log;
  121.  
  122. ##
  123. # Gzip Settings
  124. ##
  125.  
  126. gzip on;
  127. gzip_disable "msie6";
  128.  
  129. # gzip_vary on;
  130. # gzip_proxied any;
  131. # gzip_comp_level 6;
  132. # gzip_buffers 16 8k;
  133. # gzip_http_version 1.1;
  134. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  135.  
  136. ##
  137. # Virtual Host Configs
  138. ##
  139.  
  140. include /etc/nginx/conf.d/*.conf;
  141. include /etc/nginx/sites-enabled/*;
  142. }
  143.  
  144.  
  145. #mail {
  146. #
  147. # # auth_http localhost/auth.php;
  148. # # pop3_capabilities "TOP" "USER";
  149. # # imap_capabilities "IMAP4rev1" "UIDPLUS";
  150. #
  151. # server {
  152. # listen localhost:110;
  153. # protocol pop3;
  154. # proxy on;
  155. # }
  156. #
  157. # server {
  158. # listen localhost:143;
  159. # protocol imap;
  160. # proxy on;
  161. # }
  162. #}
  163.  
  164.  
  165. These are my HHVM Config
  166.  
  167. location ~ .(hh|php)$ {
  168. fastcgi_keep_conn on;
  169. fastcgi_pass 127.0.0.1:9000;
  170. fastcgi_index index.php;
  171. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  172. include fastcgi_params;
  173. }
  174.  
  175. upstream php {
  176. server unix:/var/run/hhvm/hhvm.sock;
  177. server unix:/var/run/php/php7.0-fpm.sock backup;
  178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement