## Nginx操作文档
1.到nginx官网上下载相应的安装包,<http://nginx.org/en/download.html>;
2.解压安装包到指定文件夹下(例:D:\Nginx\nginx-1.14.2)
3.cmd窗口在D:\Nginx\nginx-1.14.2目录下 执行 start nginx 启动nginx
4.启动成功后在浏览器访问localhost 出现Welcome to nginx! 页面即为成功
```
start nginx //启动nginx
nginx -s stop //停止nginx
nginx -s reload //重新加载nginx
nginx -s quit //退出nginx
```
5.前端代码打包放入/usr/local/nginx/html下
6.编辑/usr/local/nginx/conf 的 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 6079;
#本地服务ip
server_name localhost;
location / {
#前端代码目录
root /usr/local/nginx/html/Cosmo;
#首页
index index.html;
}
}
# 将 */dds/* 的url中/dds之前的由以下url代理
location /dds/ {
proxy_pass http://192.168.1.157:8081;
}
}