In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Nginx configuration file download and online browsing
1. Master configuration file
# vim nginx.confuser nginx;worker_processes 2 workerworkers are responsible for error log / usr/local/nginx/logs/error.log warn;pid / usr/local/nginx/logs/nginx.pid;events {use epoll; worker_connections 4096; multi_accept on;} http {include mime.types; default_type application/octet-stream Log_format main'$remote_addr-$remote_user [$time_local] "$request"'$status $body_bytes_sent "$http_referer"'"$http_user_agent" $http_x_forwarded_for'; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; client_header_timeout 20; client_body_timeout 20 Send_timeout 30; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 4; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; include fastcgi_params; include / usr/local/nginx/conf/vhosts/*.conf;}
two。 Download configuration file
# vim toms-file.conf server {listen 80; server_name 10.1.1.222; access_log / data/logs/file_seedeer.log main; index index.html index.htm index.php; root / pdf_data/pdf; access_log_bypass_if ($remote_addr ~ *'^ 100.97') and; access_log_bypass_if ($request ~ * "HEAD / HTTP/1.0") Access_log / usr/local/nginx/logs/api_toms.log; charset utf-8; location / {autoindex on; autoindex_exact_size on; autoindex_localtime on; if ($request_filename ~ * ^. *?\. (txt | doc | pdf | rar | gz | zip | docx | exe | xlsx | ppt | pptx) $) {add_header Content-Disposition: 'pawned adversarial' }} location ~. *\. (gif | jpg | jpeg | png | bmp | swf | mp3) ${expires 30d;} location ~. *\. (js | css)? ${expires 30d;}}
3. Description
Location / {autoindex on; autoindex_exact_size on; autoindex_localtime on; if ($request_filename ~ * ^. *?\. (txt | doc | pdf | rar | zip | docx | exe | xlsx | ppt | pptx) $) {add_header Content-Disposition: 'pawning adversarial;}}
The above configuration allows the file format suffix, the file can be opened, can be downloaded.
Charset utf-8; / / supported character set, otherwise Chinese characters will be garbled
4. Test file preview and download
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.