zoukankan      html  css  js  c++  java
  • nginx常用命令及nginx.conf基本配置

    进入nginx安装目录后执行命令!

    1、启动:start nginx 默认是根据nginx.conf来启动的。
    如果要指定配置文件来启动则使用以下命令即可:nginx -c ./conf/jason.conf
    2、关闭:nginx -s stop 快速关闭nginx服务。
    nginx -s quit 优雅的关闭,优雅是指当一个请求被处理完成之后才被关闭。

    在linux下进行关闭nginx:

    1、优雅关闭
    先找出nginx的进程号:`ps -ef|grep nginx
    执行命令:kill -QUIT pid
    2、快速关闭
    也是要先找出nginx的进程号,然后执行kill -TERM pid

    3、 nginx -t 检查配置是否有错误

    4、nginx -s reload  刷新nginx配置文件

    5、nginx.conf基本配置

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

    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log logs/access.log main;

    sendfile on;
    #tcp_nopush on;

    #keepalive_timeout 0;
    keepalive_timeout 65;

    #gzip on;

    server {
    listen 80;
    server_name localhost;

    #charset koi8-r;

    #access_log logs/host.access.log main;
    #设备pc端webapi
    location /EQUIPMENT_API/ {
    proxy_pass http://127.0.0.1:8072/EQUIPMENT_API/;
    }
    #设备pc端前端
    location /dist/ {
    proxy_pass http://127.0.0.1:8072/;
    }
    #设备pc端访问手机端附件图片静态文件
    location /EQUIPMENT_API/BusinessCheckFile/ {
    alias "E:/IIS/AppWebApiPublish/UploadFiles/BusinessCheckFile/";
    }
    #手机端webapi
    location /Equipment_App_Api/ {
    proxy_pass http://127.0.0.1:8070/;
    }

  • 相关阅读:
    Linux安装gitlab
    logback日志配置
    spring源码-aop动态代理-5.3
    【转】阿里云免费SSL证书申请与安装使用(IIS7)
    WebApi 全局使用filter
    Mint-UI Picker 三级联动
    P标签莫名有了margin-top值的原因
    Vue为v-html中标签添加CSS样式
    【转】C# string数组转int数组
    【转】SQLServer汉字转全拼音函数
  • 原文地址:https://www.cnblogs.com/zhang-wenbin/p/13685205.html
Copyright © 2011-2022 走看看