Windows10子系统Ubuntu 安装nginx并配置

安装命令

apt install nginx

启动服务

service nginx start
service nginx stop
service nginx restart

查看网页

http://127.0.0.1/

Windows10子系统Ubuntu 安装nginx并配置_第1张图片

查看测试配置文件

nginx -t

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    server {
        listen       88;
        server_name  localhost;


        location / {
            root   /mnt/d/程序缓存/jupyter/html;
            index  index.html index.htm;
        }

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


    }

}

 

你可能感兴趣的:(Linux)