编程技术分享平台

网站首页 > 技术教程 正文

NGINX开启目录浏览功能及跳转(nginx 开启目录浏览)

xnh888 2024-09-16 07:27:47 技术教程 25 ℃ 0 评论

开启目录浏览功

worker_processes 1;

events {

worker_connections 1024;

}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

server {

listen 80;

server_name localhost;

charset utf-8,gbk; #解决乱码

location / {

root html;

autoindex on;

autoindex_exact_size off;

autoindex_localtime on; #网站根目录开启目录浏览功能

index index.html index.htm;

}

location /AW {

autoindex on;

autoindex_exact_size off;

autoindex_localtime on; #网站根目录下AW目录开启目录浏览功能

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

}

URL跳转

worker_processes 2;

worker_cpu_affinity 0001 0010;

events {

worker_connections 1024;

}

http {

include mime.types;

default_type application/octet-stream;

sendfile on;

keepalive_timeout 65;

server {

listen 80;

server_name localhost;

location / {

root html;

charset utf-8,gbk;

rewrite “^/(.*)$” http://3.15.39.1/AW last;

index index.html index.htm;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

location /AW {

autoindex on;

autoindex_exact_size off;

autoindex_localtime on;

}

}

include vhost/*.conf;

}

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表