0
我想將子文件夾和所有內容重定向到根域。nginx將子文件夾重定向到根域
例如:
http://www.example.com/ubb/會重定向到http://www.example.com
我的服務器配置如下圖所示:使用htaccess的here
server {
listen 80 default_server;
root /home/vishant/devcenter/wava-v1.1/HTML;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name baetter.l;
location/{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
#proxy_pass "http://127.0.0.1:3000";
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
}
我也發現了類似的問題解決了,但怎麼能我在nginx中實現?