Advertisement
Guest User

1

a guest
Nov 24th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.99 KB | None | 0 0
  1. server {
  2.         listen   443 ssl http2;
  3.         server_name www.domain.com.com;
  4.  
  5.         # SSL
  6.         ssl_certificate /etc/letsencrypt/live/domain.com.com/fullchain.pem;
  7.         ssl_certificate_key /etc/letsencrypt/live/domain.com.com/privkey.pem;
  8.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  9.         ssl_prefer_server_ciphers on;
  10.         ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  11.         rewrite ^(.*) https://domain.com.com$1 permanent;
  12.         }
  13. server {
  14.         listen 80;
  15.  
  16.         server_name domain.com.com www.domain.com.com;
  17.         rewrite ^(.*) https://domain.com.com$1 permanent;
  18. }
  19.  
  20. server {
  21.         listen 443 ssl http2;
  22.  
  23.         # access_log off;
  24.         access_log /home/domain.com.com/logs/access.log;
  25.         # error_log off;
  26.         error_log /home/domain.com.com/logs/error.log;
  27.  
  28.         root /home/domain.com.com/public_html;
  29.         index index.php index.html index.htm;
  30.         server_name domain.com.com;
  31. # SSL
  32.         ssl_certificate /etc/letsencrypt/live/domain.com.com/fullchain.pem;
  33.         ssl_certificate_key /etc/letsencrypt/live/domain.com.com/privkey.pem;
  34.  
  35.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  36.         ssl_prefer_server_ciphers on;
  37.         ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  38.  
  39.         # Improve HTTPS performance with session resumption
  40.         ssl_session_cache shared:SSL:50m;
  41.         ssl_session_timeout 1d;
  42.  
  43.         # DH parameters
  44.         ssl_dhparam /etc/nginx/ssl/dhparam.pem;
  45.         # Enable HSTS
  46.         add_header Strict-Transport-Security "max-age=31536000" always;
  47.  
  48.         location / {
  49.                 try_files $uri $uri/ /index.php?$args;
  50.         }
  51.  
  52.         # Custom configuration
  53.         include /home/domain.com.com/public_html/*.conf;
  54.  
  55.         location ~ \.php$ {
  56.                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
  57.                 include /etc/nginx/fastcgi_params;
  58.                 fastcgi_pass 127.0.0.1:9000;
  59.                 fastcgi_index index.php;
  60.                 fastcgi_connect_timeout 1000;
  61.                 fastcgi_send_timeout 1000;
  62.                 fastcgi_read_timeout 1000;
  63.                 fastcgi_buffer_size 256k;
  64.                 fastcgi_buffers 4 256k;
  65.                 fastcgi_busy_buffers_size 256k;
  66.                 fastcgi_temp_file_write_size 256k;
  67.  
  68.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  69.         }
  70.  
  71.         location /nginx_status {
  72.                 stub_status on;
  73.                 access_log   off;
  74.                 allow 127.0.0.1;
  75.                 allow 144.217.14.122;
  76.                 deny all;
  77.         }
  78.  
  79.         location /php_status {
  80.                 fastcgi_pass 127.0.0.1:9000;
  81.                 fastcgi_index index.php;
  82.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  83.                 include /etc/nginx/fastcgi_params;
  84.                 allow 127.0.0.1;
  85.                 allow 144.217.14.122;
  86.                 deny all;
  87.         }
  88.  
  89.         # Disable .htaccess and other hidden files
  90.         location ~ /\.(?!well-known).* {
  91.                 deny all;
  92.                 access_log off;
  93.                 log_not_found off;
  94.         }
  95.  
  96.         location = /favicon.ico {
  97.                 log_not_found off;
  98.                 access_log off;
  99.         }
  100.         location = /robots.txt {
  101.                 allow all;
  102.                 log_not_found off;
  103.                 access_log off;
  104.         }
  105.  
  106.         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)$ {
  107.                 gzip_static off;
  108.                 add_header Pragma public;
  109.                 add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  110.                 access_log off;
  111.                 expires 30d;
  112.                 break;
  113.         }
  114.  
  115.         location ~* \.(txt|js|css)$ {
  116.                 add_header Pragma public;
  117.                 add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  118.                 access_log off;
  119.                 expires 30d;
  120.                 break;
  121.         }
  122. }
  123.  
  124. server {
  125.         listen 2020 ssl http2;
  126.         access_log off;
  127.         log_not_found off;
  128.         error_log /home/domain.com.com/logs/nginx_error.log;
  129.  
  130.         root /home/domain.com.com/private_html;
  131.         index index.php index.html index.htm;
  132.         server_name domain.com.com;
  133.   GNU nano 2.0.9                                                                   File: /etc/nginx/conf.d/domain.com.com.conf
  134.  
  135.         error_page  497 https://$server_name:2020$request_uri;
  136.     # SSL
  137.         ssl_certificate /etc/letsencrypt/live/domain.com.com/fullchain.pem;
  138.         ssl_certificate_key /etc/letsencrypt/live/domain.com.com/privkey.pem;
  139.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  140.         ssl_prefer_server_ciphers on;
  141.         ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  142.  
  143.         auth_basic "Restricted";
  144.         auth_basic_user_file /home/domain.com.com/private_html/domain.com/.htpasswd;
  145.  
  146.         location / {
  147.                 autoindex on;
  148.                 try_files $uri $uri/ /index.php;
  149.         }
  150.  
  151.         location ~ \.php$ {
  152.                 fastcgi_split_path_info ^(.+\.php)(/.+)$;
  153.                 include /etc/nginx/fastcgi_params;
  154.                 fastcgi_pass 127.0.0.1:9000;
  155.                 fastcgi_index index.php;
  156.                 fastcgi_connect_timeout 1000;
  157.                 fastcgi_send_timeout 1000;
  158.                 fastcgi_read_timeout 1000;
  159.                 fastcgi_buffer_size 256k;
  160.                 fastcgi_buffers 4 256k;
  161.                 fastcgi_busy_buffers_size 256k;
  162.                 fastcgi_temp_file_write_size 256k;
  163.                 fastcgi_intercept_errors on;
  164.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  165.         }
  166.  
  167.         location ~ /\. {
  168.                 deny all;
  169.         }
  170. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement