nginx 部署静态html

参考 https://www.cnblogs.com/jiuyi/p/11095268.html 详细解说安装部署 ,详解
去nginx.org 官网下载

    
1.   cd c:\nginx-1.15.2    ----- 一定要在dos窗口启动,不要直接双击nginx.exe,这样会导致修改配置后重启、停止nginx无效 
2.   start nginx      ---启动nginx服务,启动时会一闪而过是正常的
3.   tasklist /fi "imagename eq nginx.exe"   ---查看任务进程是否存在,dos或打开任务管理器都行
4. 打开任务管理器 -  详细信息 隐藏的nginx.exe进程2个
5.ru果都没有可能是启动报错了查看一下日志,在nginx/logs/erro文件夹下error.log是日志文件
6.修改配置文件 conf /nginx.conf
7.nginx -t -c  ./conf/nginx.conf   ---修改后 检查一下配置文件是否正确 ,successful就说明正确了
8.nginx -s reload  命令重新加载配置文件并重启  
9.nginx -s stop  - --- 快速停止服务
10.nginx -s quit  ---完整有序的关闭

第一种

---前端 
  server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   E:/dist;
            index  index.html index.htm;
        }
}
----后端
server {
    listen 81;
    server_name aaa.abc.com;
    charset utf-8;
    location / {
      proxy_pass http://localhost:83;
    }
  }

第二种 只映射静态html,启动jar 在html中直接访问jar端口的api

第三种 用tomcat 映射 html  放在webapp下 ROOT
 

猜你喜欢

转载自blog.csdn.net/somdip/article/details/107717751