去掉Server响应头
修改 nginx.conf
添加如下配置
server_tokens off
主机配置
在 http
配置段增加如下配置
server {
#监听湍口
listen 80;
#域名,多个域名用空格隔开
server_name *.vuecode.net doc.vuecode.net;
#允许上传文件的最大体积,默认是2m
client_max_body_size 32m;
#网站目录路径
root /var/www/html/app;
#是否开启目录浏览
autoindex off;
#反向代理
location / {
#将请求头中的host发送给服务器
proxy_set_header Host $host;
#请求发送到哪个地址
proxy_pass http://127.0.0.1:8888/;
}
}