SHOW:
|
|
- or go back to the newest paste.
| 1 | - | server { |
| 1 | + | server {
|
| 2 | - | listen 443 ssl; |
| 2 | + | listen 443 ssl; |
| 3 | - | server_name www.dormain.com; |
| 3 | + | server_name dormain.com; |
| 4 | ||
| 5 | - | # SSL |
| 5 | + | # SSL |
| 6 | - | ssl_certificate /etc/letsencrypt/live/dormain.com/fullchain.pem; |
| 6 | + | ssl_certificate /etc/letsencrypt/live/www.dormain.com/fullchain.pem; |
| 7 | - | ssl_certificate_key /etc/letsencrypt/live/dormain.com/privkey.pem; |
| 7 | + | ssl_certificate_key /etc/letsencrypt/live/www.dormain.com/privkey.pem; |
| 8 | - | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 8 | + | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 9 | - | ssl_prefer_server_ciphers on; |
| 9 | + | ssl_prefer_server_ciphers on; |
| 10 | - | ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; |
| 10 | + | ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; |
| 11 | ||
| 12 | - | rewrite ^(.*) https://dormain.com$1 permanent; |
| 12 | + | rewrite ^(.*) https://www.dormain.com$1 permanent; |
| 13 | - | } |
| 13 | + | } |
| 14 | - | server { |
| 14 | + | server {
|
| 15 | - | listen 80; |
| 15 | + | listen 80; |
| 16 | - | server_name www.dormain.com; |
| 16 | + | server_name dormain.com www.dormain.com; |
| 17 | - | rewrite ^(.*) https://dormain.com$1 permanent; |
| 17 | + | rewrite ^(.*) https://www.dormain.com$1 permanent; |
| 18 | - | } |
| 18 | + | } |
| 19 | ||
| 20 | - | server { |
| 20 | + | server {
|
| 21 | - | server_name dormain.com; |
| 21 | + | listen 443 ssl; |
| 22 | - | return 301 $scheme://www.dormain.com$request_uri; |
| 22 | + | |
| 23 | - | } |
| 23 | + | # access_log off; |
| 24 | access_log /home/dormain.com/logs/access.log; | |
| 25 | - | server { |
| 25 | + | # error_log off; |
| 26 | - | listen 443 ssl; |
| 26 | + | error_log /home/dormain.com/logs/error.log; |
| 27 | - | |
| 27 | + | |
| 28 | - | # access_log off; |
| 28 | + | root /home/dormain.com/public_html; |
| 29 | - | access_log /home/dormain.com/logs/access.log; |
| 29 | + | index index.php index.html index.htm; |
| 30 | - | # error_log off; |
| 30 | + | server_name www.dormain.com; |
| 31 | - | error_log /home/dormain.com/logs/error.log; |
| 31 | + | |
| 32 | - | |
| 32 | + | # SSL |
| 33 | - | root /home/dormain.com/public_html; |
| 33 | + | ssl_certificate /etc/letsencrypt/live/www.dormain.com/fullchain.pem; |
| 34 | - | index index.php index.html index.htm; |
| 34 | + | ssl_certificate_key /etc/letsencrypt/live/www.dormain.com/privkey.pem; |
| 35 | - | server_name dormain.com; |
| 35 | + | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 36 | - | |
| 36 | + | ssl_prefer_server_ciphers on; |
| 37 | - | # SSL |
| 37 | + | ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; |
| 38 | - | ssl_certificate /etc/letsencrypt/live/dormain.com/fullchain.pem; |
| 38 | + | |
| 39 | - | ssl_certificate_key /etc/letsencrypt/live/dormain.com/privkey.pem; |
| 39 | + | # Improve HTTPS performance with session resumption |
| 40 | - | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
| 40 | + | ssl_session_cache shared:SSL:50m; |
| 41 | - | ssl_prefer_server_ciphers on; |
| 41 | + | ssl_session_timeout 1d; |
| 42 | - | ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; |
| 42 | + | |
| 43 | # DH parameters | |
| 44 | - | # Improve HTTPS performance with session resumption |
| 44 | + | ssl_dhparam /etc/nginx/ssl/dhparam.pem; |
| 45 | - | ssl_session_cache shared:SSL:50m; |
| 45 | + | # Enable HSTS |
| 46 | - | ssl_session_timeout 1d; |
| 46 | + | add_header Strict-Transport-Security "max-age=31536000" always; |
| 47 | ||
| 48 | - | # DH parameters |
| 48 | + | location / {
|
| 49 | - | ssl_dhparam /etc/nginx/ssl/dhparam.pem; |
| 49 | + | try_files $uri $uri/ /index.php?$args; |
| 50 | - | # Enable HSTS |
| 50 | + | } |
| 51 | - | add_header Strict-Transport-Security "max-age=31536000" always; |
| 51 | + | |
| 52 | - | |
| 52 | + | # Custom configuration |
| 53 | - | location / { |
| 53 | + | include /home/dormain.com/public_html/*.conf; |
| 54 | - | try_files $uri $uri/ /index.php?$args; |
| 54 | + | |
| 55 | - | } |
| 55 | + | location ~ \.php$ {
|
| 56 | - | |
| 56 | + | fastcgi_split_path_info ^(.+\.php)(/.+)$; |
| 57 | - | # Custom configuration |
| 57 | + | include /etc/nginx/fastcgi_params; |
| 58 | - | include /home/dormain.com/public_html/*.conf; |
| 58 | + | fastcgi_pass 127.0.0.1:9000; |
| 59 | - | |
| 59 | + | fastcgi_index index.php; |
| 60 | - | location ~ \.php$ { |
| 60 | + | fastcgi_connect_timeout 1000; |
| 61 | - | fastcgi_split_path_info ^(.+\.php)(/.+)$; |
| 61 | + | fastcgi_send_timeout 1000; |
| 62 | - | include /etc/nginx/fastcgi_params; |
| 62 | + | fastcgi_read_timeout 1000; |
| 63 | - | fastcgi_pass 127.0.0.1:9000; |
| 63 | + | fastcgi_buffer_size 256k; |
| 64 | - | fastcgi_index index.php; |
| 64 | + | fastcgi_buffers 4 256k; |
| 65 | - | fastcgi_connect_timeout 1000; |
| 65 | + | fastcgi_busy_buffers_size 256k; |
| 66 | - | fastcgi_send_timeout 1000; |
| 66 | + | fastcgi_temp_file_write_size 256k; |
| 67 | - | fastcgi_read_timeout 1000; |
| 67 | + | fastcgi_intercept_errors on; |
| 68 | - | fastcgi_buffer_size 256k; |
| 68 | + | fastcgi_param SCRIPT_FILENAME /home/dormain.com/public_html$fastcgi_script_name; |
| 69 | - | fastcgi_buffers 4 256k; |
| 69 | + | } |
| 70 | - | fastcgi_busy_buffers_size 256k; |
| 70 | + | location /nginx_status {
|
| 71 | - | fastcgi_temp_file_write_size 256k; |
| 71 | + | stub_status on; |
| 72 | - | fastcgi_intercept_errors on; |
| 72 | + | access_log off; |
| 73 | - | fastcgi_param SCRIPT_FILENAME /home/dormain.com/public_html$fastcgi_script_name; |
| 73 | + | allow 127.0.0.1; |
| 74 | - | } |
| 74 | + | deny all; |
| 75 | - | location /nginx_status { |
| 75 | + | } |
| 76 | - | stub_status on; |
| 76 | + | location /php_status {
|
| 77 | - | access_log off; |
| 77 | + | fastcgi_pass 127.0.0.1:9000; |
| 78 | - | allow 127.0.0.1; |
| 78 | + | fastcgi_index index.php; |
| 79 | - | deny all; |
| 79 | + | fastcgi_param SCRIPT_FILENAME /home/dormain.com/public_html$fastcgi_script_name; |
| 80 | - | } |
| 80 | + | include /etc/nginx/fastcgi_params; |
| 81 | - | location /php_status { |
| 81 | + | allow 127.0.0.1; |
| 82 | - | fastcgi_pass 127.0.0.1:9000; |
| 82 | + | deny all; |
| 83 | - | fastcgi_index index.php; |
| 83 | + | } |
| 84 | - | fastcgi_param SCRIPT_FILENAME /home/dormain.com/public_html$fastcgi_script_name; |
| 84 | + | # Disable .htaccess and other hidden files |
| 85 | - | include /etc/nginx/fastcgi_params; |
| 85 | + | location ~ /\.(?!well-known).* {
|
| 86 | - | allow 127.0.0.1; |
| 86 | + | deny all; |
| 87 | - | deny all; |
| 87 | + | access_log off; |
| 88 | - | } |
| 88 | + | log_not_found off; |
| 89 | - | # Disable .htaccess and other hidden files |
| 89 | + | } |
| 90 | - | location ~ /\.(?!well-known).* { |
| 90 | + | location = /favicon.ico {
|
| 91 | - | deny all; |
| 91 | + | log_not_found off; |
| 92 | - | access_log off; |
| 92 | + | access_log off; |
| 93 | - | log_not_found off; |
| 93 | + | } |
| 94 | - | } |
| 94 | + | location = /robots.txt {
|
| 95 | - | location = /favicon.ico { |
| 95 | + | allow all; |
| 96 | - | log_not_found off; |
| 96 | + | log_not_found off; |
| 97 | - | access_log off; |
| 97 | + | access_log off; |
| 98 | - | } |
| 98 | + | } |
| 99 | - | location = /robots.txt { |
| 99 | + | 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)$ {
|
| 100 | - | allow all; |
| 100 | + | gzip_static off; |
| 101 | - | log_not_found off; |
| 101 | + | add_header Pragma public; |
| 102 | - | access_log off; |
| 102 | + | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; |
| 103 | - | } |
| 103 | + | access_log off; |
| 104 | - | 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)$ { |
| 104 | + | expires 30d; |
| 105 | - | gzip_static off; |
| 105 | + | break; |
| 106 | - | add_header Pragma public; |
| 106 | + | } |
| 107 | - | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; |
| 107 | + | |
| 108 | - | access_log off; |
| 108 | + | location ~* \.(txt|js|css)$ {
|
| 109 | - | expires 30d; |
| 109 | + | add_header Pragma public; |
| 110 | - | break; |
| 110 | + | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; |
| 111 | - | } |
| 111 | + | access_log off; |
| 112 | expires 30d; | |
| 113 | - | location ~* \.(txt|js|css)$ { |
| 113 | + | break; |
| 114 | - | add_header Pragma public; |
| 114 | + | } |
| 115 | - | add_header Cache-Control "public, must-revalidate, proxy-revalidate"; |
| 115 | + | } |
| 116 | - | access_log off; |
| 116 | + |