📜  nginx 更改根目录 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:19.095000             🧑  作者: Mango

代码示例1
edit file

> sudo vim /etc/nginx/sites-available/default

server {
    listen 80;
    listen [::]:80;
    root /mnt/volume-mn1/html; # # # change this # # #
    index  index.php index.html index.htm;
    server_name  example.com www.example.com;

    location / {
    try_files $uri $uri/ /index.php?$args;        
    }
    ...
}

save file

make sure file is ok

> sudo nginx -t

restart nginx

> sudo systemctl reload nginx.service