- server {
- listen 443 ssl;
- server_name www.lamvideo.net;
- # SSL
- ssl_certificate /etc/letsencrypt/live/lamvideo.net/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/lamvideo.net/privkey.pem;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_prefer_server_ciphers on;
- ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
- rewrite ^(.*) https://lamvideo.net$1 permanent;
- }
- server {
- listen 80;
- server_name lamvideo.net www.lamvideo.net;
- rewrite ^(.*) https://lamvideo.net$1 permanent;
- }
- server {
- listen 443 ssl default_server;
- # access_log off;
- access_log /home/lamvideo.net/logs/access.log;
- # error_log off;
- error_log /home/lamvideo.net/logs/error.log;
- root /home/lamvideo.net/public_html;
- index index.php index.html index.htm;
- server_name lamvideo.net;
- # SSL
- ssl_certificate /etc/letsencrypt/live/lamvideo.net/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/lamvideo.net/privkey.pem;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- ssl_prefer_server_ciphers on;
- ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
- # Improve HTTPS performance with session resumption
- ssl_session_cache shared:SSL:50m;
- ssl_session_timeout 1d;
- # DH parameters
- ssl_dhparam /etc/nginx/ssl/dhparam.pem;
- # Enable HSTS
- add_header Strict-Transport-Security "max-age=31536000" always;
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
- # Custom configuration
- include /home/lamvideo.net/public_html/*.conf;
- # enable ngx_pagespeed
- pagespeed on;
- pagespeed FileCachePath /var/ngx_pagespeed_cache;
- # let's speed up PageSpeed by storing it in the super duper fast memcached
- # pagespeed MemcachedThreads 1;
- # pagespeed MemcachedServers "localhost:11211";
- # disable CoreFilters
- pagespeed RewriteLevel PassThrough;
- # enable collapse whitespace filter
- pagespeed EnableFilters collapse_whitespace;
- # enable JavaScript library offload
- pagespeed EnableFilters canonicalize_javascript_libraries;
- # combine multiple CSS files into one
- pagespeed EnableFilters combine_css;
- # combine multiple JavaScript files into one
- pagespeed EnableFilters combine_javascript;
- # remove tags with default attributes
- pagespeed EnableFilters elide_attributes;
- # improve resource cacheability
- pagespeed EnableFilters extend_cache;
- # flatten CSS files by replacing @import with the imported file
- pagespeed EnableFilters flatten_css_imports;
- pagespeed CssFlattenMaxBytes 5120;
- # defer the loading of images which are not visible to the client
- pagespeed EnableFilters lazyload_images;
- # enable JavaScript minification
- pagespeed EnableFilters rewrite_javascript;
- # enable image optimization
- pagespeed EnableFilters rewrite_images;
- # pre-solve DNS lookup
- pagespeed EnableFilters insert_dns_prefetch;
- # rewrite CSS to load page-rendering CSS rules first.
- pagespeed EnableFilters prioritize_critical_css;
- pagespeed Statistics on;
- pagespeed StatisticsLogging on;
- pagespeed LogDir /var/log/pagespeed;
- pagespeed AdminPath /pagespeed_admin;
- pagespeed AdminDomains Allow *.lamvideo.net;
- location ~ \.php$ {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include /etc/nginx/fastcgi_params;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_connect_timeout 1000;
- fastcgi_send_timeout 1000;
- fastcgi_read_timeout 1000;
- fastcgi_buffer_size 256k;
- fastcgi_buffers 4 256k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_intercept_errors on;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- }
- location /nginx_status {
- stub_status on;
- access_log off;
- allow 127.0.0.1;
- allow 139.99.45.222;
- deny all;
- }
- location /php_status {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include /etc/nginx/fastcgi_params;
- allow 127.0.0.1;
- allow 139.99.45.222;
- deny all;
- }
- # Disable .htaccess and other hidden files
- location ~ /\.(?!well-known).* {
- deny all;
- access_log off;
- log_not_found off;
- }
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- 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)$ {
- gzip_static off;
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- access_log off;
- expires 30d;
- break;
- }
- location ~* \.(txt|js|css)$ {
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- access_log off;
- expires 30d;
- break;
- }
- location /phpredmin/public/ {
- try_files $uri $uri/ /phpredmin/public/index.php;
- }
- }
- server {
- listen 2018;
- access_log off;
- log_not_found off;
- error_log /home/lamvideo.net/logs/nginx_error.log;
- root /home/lamvideo.net/private_html;
- index index.php index.html index.htm;
- server_name lamvideo.net;
- auth_basic "Restricted";
- auth_basic_user_file /home/lamvideo.net/private_html/hocvps/.htpasswd;
- location / {
- autoindex on;
- try_files $uri $uri/ /index.php;
- }
- location ~ \.php$ {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- include /etc/nginx/fastcgi_params;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_connect_timeout 1000;
- fastcgi_send_timeout 1000;
- fastcgi_read_timeout 1000;
- fastcgi_buffer_size 256k;
- fastcgi_buffers 4 256k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_intercept_errors on;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- }
- location ~ /\. {
- deny all;
- }
- }