|
1 | 1 | user admin; |
2 | 2 | worker_processes 1; |
| 3 | +worker_rlimit_nofile 65535; |
3 | 4 | error_log /usr/local/hestia/log/nginx-error.log; |
4 | 5 | pid /var/run/hestia-nginx.pid; |
5 | 6 |
|
6 | 7 | events { |
7 | 8 | worker_connections 128; |
8 | 9 | use epoll; |
| 10 | + multi_accept on; |
9 | 11 | } |
10 | 12 |
|
11 | 13 | http { |
12 | 14 | # Main settings |
13 | 15 | sendfile on; |
14 | 16 | tcp_nopush on; |
15 | 17 | tcp_nodelay on; |
16 | | - client_header_timeout 1m; |
17 | | - client_body_timeout 3m; |
| 18 | + client_header_timeout 180s; |
| 19 | + client_body_timeout 180s; |
18 | 20 | client_header_buffer_size 2k; |
19 | 21 | client_body_buffer_size 256k; |
20 | 22 | client_max_body_size 256m; |
21 | | - large_client_header_buffers 4 8k; |
22 | | - send_timeout 30; |
23 | | - keepalive_timeout 60 60; |
| 23 | + large_client_header_buffers 4 8k; |
| 24 | + send_timeout 60s; |
| 25 | + keepalive_timeout 30s; |
| 26 | + keepalive_requests 100000; |
24 | 27 | reset_timedout_connection on; |
25 | 28 | server_tokens off; |
26 | 29 | server_name_in_redirect off; |
27 | 30 | server_names_hash_max_size 512; |
28 | 31 | server_names_hash_bucket_size 512; |
29 | | - |
| 32 | + charset utf-8; |
| 33 | + |
| 34 | + fastcgi_buffers 4 256k; |
| 35 | + fastcgi_buffer_size 256k; |
| 36 | + fastcgi_busy_buffers_size 256k; |
| 37 | + fastcgi_temp_file_write_size 256k; |
| 38 | + fastcgi_connect_timeout 30s; |
| 39 | + fastcgi_read_timeout 300s; |
| 40 | + fastcgi_send_timeout 180s; |
| 41 | + |
| 42 | + proxy_redirect off; |
| 43 | + proxy_set_header Host $host; |
| 44 | + proxy_set_header X-Real-IP $remote_addr; |
| 45 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 46 | + proxy_pass_header Set-Cookie; |
| 47 | + proxy_buffers 32 4k; |
| 48 | + proxy_connect_timeout 30s; |
| 49 | + proxy_read_timeout 300s; |
| 50 | + proxy_send_timeout 180s; |
30 | 51 |
|
31 | 52 | # Log format |
32 | 53 | log_format main '$remote_addr - $remote_user [$time_local] $request ' |
33 | 54 | '"$status" $body_bytes_sent "$http_referer" ' |
34 | 55 | '"$http_user_agent" "$http_x_forwarded_for"'; |
35 | 56 | log_format bytes '$body_bytes_sent'; |
36 | 57 | access_log /usr/local/hestia/log/nginx-access.log main; |
37 | | - |
38 | | - |
39 | | - # SSL PCI Compliance |
40 | | - ssl_protocols TLSv1.3 TLSv1.2 TLSv1.1; |
41 | | - ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"; |
42 | | - ssl_session_cache shared:SSL:10m; |
43 | | - ssl_prefer_server_ciphers on; |
44 | | - |
45 | | - |
| 58 | + |
46 | 59 | # Mime settings |
47 | 60 | include /usr/local/hestia/nginx/conf/mime.types; |
48 | 61 | default_type application/octet-stream; |
49 | 62 |
|
50 | | - |
51 | 63 | # Compression |
52 | 64 | gzip on; |
53 | | - gzip_comp_level 9; |
54 | | - gzip_min_length 512; |
55 | | - gzip_buffers 8 64k; |
56 | | - gzip_types text/plain text/css text/javascript |
57 | | - application/x-javascript application/javascript; |
| 65 | + gzip_static on; |
| 66 | + gzip_vary on; |
| 67 | + gzip_comp_level 6; |
| 68 | + gzip_min_length 1024; |
| 69 | + gzip_buffers 16 8k; |
| 70 | + gzip_http_version 1.1; |
| 71 | + gzip_types text/plain text/css text/javascript text/js text/xml application/json application/javascript application/x-javascript application/xml application/xml+rss application/x-font-ttf image/svg+xml font/opentype; |
58 | 72 | gzip_proxied any; |
| 73 | + gzip_disable "MSIE [1-6]\."; |
59 | 74 |
|
60 | | - |
61 | | - # Proxy settings |
62 | | - proxy_redirect off; |
63 | | - proxy_set_header Host $host; |
64 | | - proxy_set_header X-Real-IP $remote_addr; |
65 | | - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
66 | | - proxy_pass_header Set-Cookie; |
67 | | - proxy_connect_timeout 90; |
68 | | - proxy_send_timeout 90; |
69 | | - proxy_read_timeout 90; |
70 | | - proxy_buffers 32 4k; |
71 | | - fastcgi_read_timeout 300; |
| 75 | + # SSL PCI Compliance |
| 76 | + ssl_session_cache shared:SSL:10m; |
| 77 | + ssl_session_timeout 10m; |
| 78 | + ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; |
| 79 | + ssl_prefer_server_ciphers on; |
| 80 | + ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"; |
72 | 81 |
|
73 | 82 | # Error pages |
74 | 83 | error_page 403 /error/403.html; |
75 | 84 | error_page 404 /error/404.html; |
76 | 85 | error_page 502 503 504 /error/50x.html; |
77 | 86 |
|
78 | | - |
79 | 87 | # Vhost |
80 | 88 | server { |
81 | 89 | listen 8083 ssl; |
82 | 90 | server_name _; |
83 | 91 | root /usr/local/hestia/web; |
84 | | - charset utf-8; |
85 | 92 |
|
86 | 93 | # Fix error "The plain HTTP request was sent to HTTPS port" |
87 | 94 | error_page 497 https://$host:$server_port$request_uri; |
88 | 95 |
|
89 | 96 | ssl_certificate /usr/local/hestia/ssl/certificate.crt; |
90 | 97 | ssl_certificate_key /usr/local/hestia/ssl/certificate.key; |
91 | | - ssl_session_cache shared:SSL:10m; |
92 | | - ssl_session_timeout 10m; |
93 | 98 |
|
94 | 99 | error_page 404 /error/404/index.html; |
95 | 100 | error_page 403 /error/index.html; |
96 | 101 | error_page 500 /error/index.html; |
97 | 102 |
|
98 | 103 | location / { |
99 | | - expires max; |
| 104 | + expires 1d; |
100 | 105 | index index.php; |
101 | 106 | } |
102 | 107 |
|
103 | 108 | location /error/ { |
104 | | - expires max; |
| 109 | + expires off; |
105 | 110 | index index.html; |
106 | 111 | } |
107 | 112 |
|
|
0 commit comments