summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-12-03 17:32:28 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-12-03 17:32:28 +0800
commit20101c5feadd5e045e4a5fe623d96bede8dbc25a (patch)
tree808906dc76d304c4bdae5eb07525592e3d6664ca
parent9934dd538b0ce116e3b1600272cb46369b082246 (diff)
Update
-rw-r--r--nginx/nginx.conf10
-rw-r--r--nginx/sites-available/vps8
2 files changed, 9 insertions, 9 deletions
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index d0601ec..b340adc 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -22,8 +22,7 @@ http {
22 server_names_hash_bucket_size 128; 22 server_names_hash_bucket_size 128;
23 23
24 include mime.types; 24 include mime.types;
25 default_type application/octet-stream; 25 default_type "text/plain; charset=utf-8";
26 disable_symlinks off;
27 26
28 # Read manual for valid variables: 27 # Read manual for valid variables:
29 # https://nginx.org/en/docs/http/ngx_http_core_module.html#variables 28 # https://nginx.org/en/docs/http/ngx_http_core_module.html#variables
@@ -32,11 +31,12 @@ http {
32 # '$status $body_bytes_sent "$http_referer" ' 31 # '$status $body_bytes_sent "$http_referer" '
33 # '"$http_user_agent" "$http_x_forwarded_for"'; 32 # '"$http_user_agent" "$http_x_forwarded_for"';
34 log_format main '$status $request_method\t$http_host$uri\tfrom $http_referer\n' 33 log_format main '$status $request_method\t$http_host$uri\tfrom $http_referer\n'
35 '$time_iso8601 $remote_addr\r\t\t\t\t\t $http_user_agent'; 34 ' $time_iso8601 $remote_addr\r\t\t\t\t\t $http_user_agent';
36 access_log /var/log/nginx/access.log main; 35 access_log /var/log/nginx/access.log main;
37 36
38 sendfile on; 37 sendfile on;
39 #tcp_nopush on; 38 tcp_nopush on;
39 tcp_nodelay on;
40 40
41 #keepalive_timeout 0; 41 #keepalive_timeout 0;
42 keepalive_timeout 65; 42 keepalive_timeout 65;
diff --git a/nginx/sites-available/vps b/nginx/sites-available/vps
index bad4621..6fde3fb 100644
--- a/nginx/sites-available/vps
+++ b/nginx/sites-available/vps
@@ -23,16 +23,17 @@ server {
23 ssl_certificate /etc/nginx/ssl/fullchain.cert; 23 ssl_certificate /etc/nginx/ssl/fullchain.cert;
24 ssl_certificate_key /etc/nginx/ssl/cert.pem; 24 ssl_certificate_key /etc/nginx/ssl/cert.pem;
25 25
26 # files
26 root /srv/http; 27 root /srv/http;
27 index index.html; 28 index index.html;
28 autoindex on; 29 autoindex on;
29 autoindex_exact_size off; 30 autoindex_exact_size off;
31 disable_symlinks off;
30 32
31 # charset 33 # charset
32 charset utf-8; 34 charset utf-8;
33 charset_types *; 35 charset_types *;
34 override_charset on; 36 override_charset on;
35 default_type "text/plain; charset=utf-8";
36 37
37 # header 38 # header
38 proxy_set_header Host $host; 39 proxy_set_header Host $host;
@@ -306,10 +307,9 @@ server {
306server { 307server {
307 server_name "~[\d\.]+"; 308 server_name "~[\d\.]+";
308 listen 80; 309 listen 80;
309 listen 443 ssl;
310 310
311 error_page 404 /404.html; 311 root /srv/http;
312 return 404; 312 index index.html;
313} 313}
314 314
315## Redirect 80 to 443 315## Redirect 80 to 443