【发布时间】:2016-09-05 00:15:38
【问题描述】:
我正在尝试在 Linux 上配置 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;
【问题讨论】:
标签: linux nginx centos nginx-location winginx