基本操作:

1.启动nginx

{global}/nginx

例如:/usr/local/Cellar/nginx/1.13.12/bin/nginx

2.重启nginx

{global}/nginx -s reload

例如:/usr/local/Cellar/nginx/1.13.12/bin/nginx -s reload

2.终止nginx

{global}/nginx -s stop

例如:/usr/local/Cellar/nginx/1.13.12/bin/nginx -s stop

配置:

server {
listen 8080;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root html;
index index.html index.htm;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

#配置server增加服务

server {
listen 8090;
server_name localhost;
index index.html;
root /Users/caobopan/Desktop/aaa/eventAdmin0.1.6/event-admin;
}

nginx 基本操作及配置的更多相关文章

  1. Nginx安装及配置简介

    前言 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行.由俄罗斯的程序设计师Igor Sysoev所开发,供俄国大 ...

  2. nginx + SSL优化配置

    nginx + SSL优化配置: #http段添加如下配置项: http { ssl_prefer_server_ciphers on; #设置协商加密算法时,优先使用我们服务端的加密套件,而不是客户 ...

  3. nginx安装与配置

    一.在线安装 ubuntu 安装 sudo apt-get install nginx 安装后文件结构为: 配置文件:/etc/nginx ,并且每台虚拟主机已经安排在 /etc/nginx/site ...

  4. windows下nginx安装、配置与使用(转载)

    目前国内各大门户网站已经部署了Nginx,如新浪.网易.腾讯等:国内几个重要的视频分享网站也部署了Nginx,如六房间.酷6等.新近发现Nginx 技术在国内日趋火热,越来越多的网站开始部署Nginx ...

  5. 阿里云服务器Linux CentOS安装配置(八)nginx安装、配置、域名绑定

    阿里云服务器Linux CentOS安装配置(八)nginx安装.配置.域名绑定 1.安装nginx yum -y install nginx 2.启动nginx service nginx star ...

  6. nginx入门篇----nginx服务器基础配置

    1.nginx.conf文件结构...                         #全局块  events{  ...  }  http                      #http块{ ...

  7. 高流量站点NGINX与PHP-fpm配置优化(译)

    使用Nginx搭配PHP已有7年的这份经历让我们学会如何为高流量站点优化NGINX和PHP-fpm配置. 以下正是这方面的一些提示和建议: 1. 将TCP切换为UNIX域套接字 UNIX域套接字相比T ...

  8. nginx反向代理配置及优化

    nginx反向代理配置及优化前言: 由于服务器apache抗不住目前的并发.加上前端squid配置后,问题依然无法解决.而页面程序大部分是动态.无法使用fastcgi来处理.因此想使用nginx做为反 ...

  9. LVS + Keepalived + Nginx安装及配置

    1.概述 上篇文章<架构设计:负载均衡层设计方案(6)——Nginx + Keepalived构建高可用的负载层>(http://blog.csdn.net/yinwenjie/artic ...

随机推荐

  1. Linux防火墙iptables基础详解

    原文来自于:https://www.linuxidc.com/Linux/2017-01/140073.htm(引用自) 一:前言 防火墙,其实说白了讲,就是用于实现Linux下访问控制的功能的,它分 ...

  2. 在sql中select的执行顺序

    <select{[distinct |all] columns |*}> [into table_name] <from {tables |views | other select} ...

  3. varnish 相关说明

    一.关于Varnish Varnish 是一款高性能且开源的反向代理服务器和 HTTP 加速器,其采用全新的软件体系机构,和现在的硬件体系紧密配合,与传统的 squid 相比,varnish 具有性能 ...

  4. kubernetes版本融合解决方案

    kubernetes版本融合背景 在kubernetes 1.6版本的基础上进行了深度的定制.而且该版本已经相当稳定.但是随着kubernetes版本迭代,后期使用的如service mesh/kub ...

  5. 清北学堂北京大学冯哲神仙讲课day2

    今天讲基础数据结构 首先讲(二叉搜索树) 保证左儿子小于右儿子,那么对于根节点来说.大于根节点的放到右子树递归,小于根节点的放在左子树 相等的呢?某大佬(老师)这么说: 删除的前提是找这个点在哪: 如 ...

  6. mfc动态控件生成

    1.变量.函数声明 std::vector<CButton*>pBtn; afx void OnBtnClik(UINT uID);//回调函数 2.分配空间 pBtn.resize(50 ...

  7. js三种弹出框的用法

    https://blog.csdn.net/cui_angel/article/details/7784211 js中prompt()的用法

  8. ojdbc包加入本地仓库

    mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar - ...

  9. 一.MySQL安装

    版本:linux7.6 一.编译安装 1.下载epel源 [root@db01 ~]# wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyu ...

  10. qt连接数据库Sqlite

    #include <QCoreApplication> #include <QDebug> #include <QSqlDatabase> #include < ...