nginx 一个端口 多个 location 站点配置使用alias

cat nginx.conf

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;
location /test1 {
root html/test1;
index index.html index.htm;
}

location /test2 {
alias html/test2;
index index.html index.htm;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

posted @ 2021-04-27 17:48  苦读二十年  阅读(652)  评论(0编辑  收藏  举报