nginx 基本操作及配置
基本操作:
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 基本操作及配置的更多相关文章
- Nginx安装及配置简介
前言 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like 协议下发行.由俄罗斯的程序设计师Igor Sysoev所开发,供俄国大 ...
- nginx + SSL优化配置
nginx + SSL优化配置: #http段添加如下配置项: http { ssl_prefer_server_ciphers on; #设置协商加密算法时,优先使用我们服务端的加密套件,而不是客户 ...
- nginx安装与配置
一.在线安装 ubuntu 安装 sudo apt-get install nginx 安装后文件结构为: 配置文件:/etc/nginx ,并且每台虚拟主机已经安排在 /etc/nginx/site ...
- windows下nginx安装、配置与使用(转载)
目前国内各大门户网站已经部署了Nginx,如新浪.网易.腾讯等:国内几个重要的视频分享网站也部署了Nginx,如六房间.酷6等.新近发现Nginx 技术在国内日趋火热,越来越多的网站开始部署Nginx ...
- 阿里云服务器Linux CentOS安装配置(八)nginx安装、配置、域名绑定
阿里云服务器Linux CentOS安装配置(八)nginx安装.配置.域名绑定 1.安装nginx yum -y install nginx 2.启动nginx service nginx star ...
- nginx入门篇----nginx服务器基础配置
1.nginx.conf文件结构... #全局块 events{ ... } http #http块{ ...
- 高流量站点NGINX与PHP-fpm配置优化(译)
使用Nginx搭配PHP已有7年的这份经历让我们学会如何为高流量站点优化NGINX和PHP-fpm配置. 以下正是这方面的一些提示和建议: 1. 将TCP切换为UNIX域套接字 UNIX域套接字相比T ...
- nginx反向代理配置及优化
nginx反向代理配置及优化前言: 由于服务器apache抗不住目前的并发.加上前端squid配置后,问题依然无法解决.而页面程序大部分是动态.无法使用fastcgi来处理.因此想使用nginx做为反 ...
- LVS + Keepalived + Nginx安装及配置
1.概述 上篇文章<架构设计:负载均衡层设计方案(6)——Nginx + Keepalived构建高可用的负载层>(http://blog.csdn.net/yinwenjie/artic ...
随机推荐
- ubuntu 17.10 安装mvn
首先,我用的系统是Ubuntu17.10,编辑器用的 vim ,Maven以 3.5.0为例 第一步,去官网下载maven. 官网下载页面.png 第二步,解压到/opt/maven目录(我安装在这个 ...
- animate.css 动画的使用
$('#animatedClose').removeClass().addClass('fadeInDownBig animated').one('webkitAnimationEnd mozAnim ...
- git+webpack项目初始化<一>
目录结构 src + page view image service util git初始化 linux常用命令 rm -rf mmall-fe/ 删除 mkdir mmall-fe 创建文件夹 ls ...
- 删除zabbix数据库日志
#!/bin/bashuser="root"passwd="361way"timedate=`date -d $(date -d "-90 day&q ...
- Java之冒泡算法实现
算法说明:给一列数组排序,当前一个元素大于后一个元素则交换这两个元素的顺序,直到最大的数字移动到最右边,以剩下n-1元素组成的数组当做最新数组,重复交换过程,直到这个数组全部处理完毕.传的参数一个是数 ...
- ASP.NET - Validators
ASP.NET validation controls validate the user input data to ensure that useless, unauthenticated, or ...
- [译]RabbitMQ教程C#版 - 主题
先决条件 本教程假定 RabbitMQ 已经安装,并运行在localhost标准端口(5672).如果你使用不同的主机.端口或证书,则需要调整连接设置. 从哪里获得帮助 如果您在阅读本教程时遇到困难, ...
- 解决win10 蓝牙设备只能配对无法连接 ,并且删除设备无效的问题
系统环境: win10家庭版 dell本 问题描述:蓝牙设备(比如蓝牙键盘,蓝牙音箱)出现无法连接的情况,打算删除已配对的设备,再重新配对连接.但删除设备后重启蓝牙,那些原本被删除的设备又自动配对上, ...
- Lintcode85-Insert Node in a Binary Search Tree-Easy
85. Insert Node in a Binary Search Tree Given a binary search tree and a new tree node, insert the n ...
- Visual Studio提示“无法启动IIS Express Web服务器”的解决方法 调试闪退
有时,在使用Visual Studio运行ASP.NET项目时,会提示“无法启动IIS Express Web服务器”,无法运行,如图: 这一般出现在重装系统之后,或者项目是从别的电脑上复制过来的.解 ...