我試圖在Linux上配置從目錄下載任何文件的NGINX服務器。如何配置下載任何文件的NGINX服務器
但是,我面臨的問題是,當文件是一個文本文件或文件名稱包含任何特殊的字符,如空格和(「()」#「&」),那麼瀏覽器將不會招待和給我什麼。
我該如何解決這個問題? 我的配置是休耕
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
#default_type application/*;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
index index.html index.htm;
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location/{}
error_page 404找到/404.html; error_page 500 502 503 504 /50x.html;