nginx---conf


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


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

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       8899;
        server_name  localhost;

        location / {
            root   D:/0-workspace/door-web-operator;
            index  index.html index.htm;
            try_files $uri $uri/ /dist/index.html;
            #add_header Access-Control-Allow-Origin *;
        }
 
        #反向代理的路径(和upstream绑定),location 后面设置映射的路径
        location /api {
            proxy_pass https://smartcampus..com;
        }
    }
}

你可能感兴趣的:(nginx---conf)