1. server {
  2. listen 443 ssl;
  3. server_name www.lamvideo.net;
  4. # SSL
  5. ssl_certificate /etc/letsencrypt/live/lamvideo.net/fullchain.pem;
  6. ssl_certificate_key /etc/letsencrypt/live/lamvideo.net/privkey.pem;
  7. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  8. ssl_prefer_server_ciphers on;
  9. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  10. rewrite ^(.*) https://lamvideo.net$1 permanent;
  11. }
  12. server {
  13. listen 80;
  14. server_name lamvideo.net www.lamvideo.net;
  15. rewrite ^(.*) https://lamvideo.net$1 permanent;
  16. }
  17. server {
  18. listen 443 ssl default_server;
  19. # access_log off;
  20. access_log /home/lamvideo.net/logs/access.log;
  21. # error_log off;
  22. error_log /home/lamvideo.net/logs/error.log;
  23. root /home/lamvideo.net/public_html;
  24. index index.php index.html index.htm;
  25. server_name lamvideo.net;
  26. # SSL
  27. ssl_certificate /etc/letsencrypt/live/lamvideo.net/fullchain.pem;
  28. ssl_certificate_key /etc/letsencrypt/live/lamvideo.net/privkey.pem;
  29. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  30. ssl_prefer_server_ciphers on;
  31. ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  32. # Improve HTTPS performance with session resumption
  33. ssl_session_cache shared:SSL:50m;
  34. ssl_session_timeout 1d;
  35. # DH parameters
  36. ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  37. # Enable HSTS
  38. add_header Strict-Transport-Security "max-age=31536000" always;
  39. location / {
  40. try_files $uri $uri/ /index.php?$args;
  41. }
  42. # Custom configuration
  43. include /home/lamvideo.net/public_html/*.conf;
  44. # enable ngx_pagespeed
  45. pagespeed on;
  46. pagespeed FileCachePath /var/ngx_pagespeed_cache;
  47. # let's speed up PageSpeed by storing it in the super duper fast memcached
  48. # pagespeed MemcachedThreads 1;
  49. # pagespeed MemcachedServers "localhost:11211";
  50. # disable CoreFilters
  51. pagespeed RewriteLevel PassThrough;
  52. # enable collapse whitespace filter
  53. pagespeed EnableFilters collapse_whitespace;
  54. # enable JavaScript library offload
  55. pagespeed EnableFilters canonicalize_javascript_libraries;
  56. # combine multiple CSS files into one
  57. pagespeed EnableFilters combine_css;
  58. # combine multiple JavaScript files into one
  59. pagespeed EnableFilters combine_javascript;
  60. # remove tags with default attributes
  61. pagespeed EnableFilters elide_attributes;
  62. # improve resource cacheability
  63. pagespeed EnableFilters extend_cache;
  64. # flatten CSS files by replacing @import with the imported file
  65. pagespeed EnableFilters flatten_css_imports;
  66. pagespeed CssFlattenMaxBytes 5120;
  67. # defer the loading of images which are not visible to the client
  68. pagespeed EnableFilters lazyload_images;
  69. # enable JavaScript minification
  70. pagespeed EnableFilters rewrite_javascript;
  71. # enable image optimization
  72. pagespeed EnableFilters rewrite_images;
  73. # pre-solve DNS lookup
  74. pagespeed EnableFilters insert_dns_prefetch;
  75. # rewrite CSS to load page-rendering CSS rules first.
  76. pagespeed EnableFilters prioritize_critical_css;
  77. pagespeed Statistics on;
  78. pagespeed StatisticsLogging on;
  79. pagespeed LogDir /var/log/pagespeed;
  80. pagespeed AdminPath /pagespeed_admin;
  81. pagespeed AdminDomains Allow *.lamvideo.net;
  82. location ~ \.php$ {
  83. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  84. include /etc/nginx/fastcgi_params;
  85. fastcgi_pass 127.0.0.1:9000;
  86. fastcgi_index index.php;
  87. fastcgi_connect_timeout 1000;
  88. fastcgi_send_timeout 1000;
  89. fastcgi_read_timeout 1000;
  90. fastcgi_buffer_size 256k;
  91. fastcgi_buffers 4 256k;
  92. fastcgi_busy_buffers_size 256k;
  93. fastcgi_temp_file_write_size 256k;
  94. fastcgi_intercept_errors on;
  95. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  96. }
  97. location /nginx_status {
  98. stub_status on;
  99. access_log off;
  100. allow 127.0.0.1;
  101. allow 139.99.45.222;
  102. deny all;
  103. }
  104. location /php_status {
  105. fastcgi_pass 127.0.0.1:9000;
  106. fastcgi_index index.php;
  107. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  108. include /etc/nginx/fastcgi_params;
  109. allow 127.0.0.1;
  110. allow 139.99.45.222;
  111. deny all;
  112. }
  113. # Disable .htaccess and other hidden files
  114. location ~ /\.(?!well-known).* {
  115. deny all;
  116. access_log off;
  117. log_not_found off;
  118. }
  119. location = /favicon.ico {
  120. log_not_found off;
  121. access_log off;
  122. }
  123. location = /robots.txt {
  124. allow all;
  125. log_not_found off;
  126. access_log off;
  127. }
  128. location ~* \.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|eot|svg|ttf|woff)$ {
  129. gzip_static off;
  130. add_header Pragma public;
  131. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  132. access_log off;
  133. expires 30d;
  134. break;
  135. }
  136. location ~* \.(txt|js|css)$ {
  137. add_header Pragma public;
  138. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  139. access_log off;
  140. expires 30d;
  141. break;
  142. }
  143. location /phpredmin/public/ {
  144. try_files $uri $uri/ /phpredmin/public/index.php;
  145. }
  146. }
  147. server {
  148. listen 2018;
  149. access_log off;
  150. log_not_found off;
  151. error_log /home/lamvideo.net/logs/nginx_error.log;
  152. root /home/lamvideo.net/private_html;
  153. index index.php index.html index.htm;
  154. server_name lamvideo.net;
  155. auth_basic "Restricted";
  156. auth_basic_user_file /home/lamvideo.net/private_html/hocvps/.htpasswd;
  157. location / {
  158. autoindex on;
  159. try_files $uri $uri/ /index.php;
  160. }
  161. location ~ \.php$ {
  162. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  163. include /etc/nginx/fastcgi_params;
  164. fastcgi_pass 127.0.0.1:9000;
  165. fastcgi_index index.php;
  166. fastcgi_connect_timeout 1000;
  167. fastcgi_send_timeout 1000;
  168. fastcgi_read_timeout 1000;
  169. fastcgi_buffer_size 256k;
  170. fastcgi_buffers 4 256k;
  171. fastcgi_busy_buffers_size 256k;
  172. fastcgi_temp_file_write_size 256k;
  173. fastcgi_intercept_errors on;
  174. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  175. }
  176. location ~ /\. {
  177. deny all;
  178. }
  179. }