#### 1、下載安裝包
版本:1.14.2
[http://nginx.org/en/download.html](http://nginx.org/en/download.html)
#### 2、解壓到相應路徑
#### 3、進入cmd窗口,進入路徑
~~~
cd /d e:\nginx
start nginx.exe
nginx -s reload
nginx -s stop
nginx -s quit
~~~
#### 4、配置文件
配置文件目錄為conf,配置文件為nginx.conf
~~~
?
#user nobody;
worker_processes ?1;
?
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
?
#pid ? ? ? logs/nginx.pid;
?
?
events {
? ?worker_connections ?1024;
}
?
?
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;
?
? ? ? ?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;
? ? ? ?#}
? ?}
?
?
? ?# another virtual host using mix of IP-, name-, and port-based configuration
? ?#
? ?#server {
? ?# ? listen ? ? ? 8000;
? ?# ? listen ? ? ? somename:8080;
? ?# ? server_name somename alias another.alias;
?
? ?# ? location / {
? ?# ? ? ? root ? html;
? ?# ? ? ? index index.html index.htm;
? ?# ? }
? ?#}
?
?
? ?# HTTPS server
? ?#
? ?#server {
? ?# ? listen ? ? ? 443 ssl;
? ?# ? server_name localhost;
?
? ?# ? ssl_certificate ? ? cert.pem;
? ?# ? ssl_certificate_key cert.key;
?
? ?# ? ssl_session_cache ? shared:SSL:1m;
? ?# ? ssl_session_timeout 5m;
?
? ?# ? ssl_ciphers HIGH:!aNULL:!MD5;
? ?# ? ssl_prefer_server_ciphers on;
?
? ?# ? location / {
? ?# ? ? ? root ? html;
? ?# ? ? ? index index.html index.htm;
? ?# ? }
? ?#}
?
}
?
~~~
- Linux
- linux常用命令
- awk
- cp
- scp
- mv
- screen工具
- rsync
- Linux設置靜態IP
- vim常用
- ssh免密登錄
- linux掛載磁盤和開機自動掛載
- 文件的時間戳
- 重定向
- 防火墻
- Vultr 服務器利用快照更換IP
- ss
- node-yarn
- ES安裝向導
- lnmp/lamp
- windows安裝mysql
- windows安裝nginx
- Let'sEncrypt 免費通配符/泛域名SSL證書
- 開機自動掛載硬盤
- 普通用戶提權
- ELK日志分析系統
- Docker
- docker
- centos7安裝docker
- Centos7安裝redis
- CentOS 7 使用Docker搭建Nginx
- CentOS 7 使用Docker搭建Jenkins
- CentOS 7 使用Docker搭建Zookeeper
- CentOS 7 使用Docker搭建Tomcat
- CentOS 7 使用Docker搭建Mysql
- CentOS 7 使用Docker搭建PHP環境
- 使用docker搭建Swagger
- docker阿里云私有倉庫
- docker zookeeper集群
- docker部署ES
- docker之java容器運行外置springboot-jar
- docker部署owncloud云盤
- ETCD
- centos7部署etcd節點
- Dockerfile
- Docker-compose
- gitlab.yml
- db.yml
- 安裝docker-compose
- gitlab-docker-compose.yml
- nginx-docker-compose.yml
- Mysql
- mysql開啟遠程訪問及相關權限控制
- mysql授權
- mysql快速導出導入大數據
- mysql單機備份
- binlog日志
- shell
- 經典案例
- 俄羅斯方塊游戲
- 系統初始化
- 服務器監控
- go基礎環境
- shell.監控日志.elk
- shell.檢查各服務腳本
- shell.刪除文件腳本
- shell.守護進程
- shell.數據庫
- shell.Ansible
- shell.dev
- shell.ftp環境
- shell.docker環境
- shell.k8s環境
- k8s.二進制安裝
- K8s.一主多從
- k8s.三主兩從高可用
- k8s.檢查服務與配置
- k8s.jenkins
- k8s.gitlab
- go-install.sh
- jenkins-install.sh
- node-install.sh
- redis-install.sh
- zabbix-install.sh
- zabbix-dockerfile.sh
- nginx-install.sh
- shell變量
- 用戶自定義變量
- 環境變量
- shell特殊變量
- shell條件判斷
- 流程控制
- shell運算符
- Shell _printf
- shell_test
- shell函數
- 輸出重定向
- 網絡相關
- 安全相關
- 堡壘機部署
- 區塊鏈威脅情報共享平臺
- 簽名與驗簽
- 淺談區塊鏈
- 智能合約
- 黃金幣GTF智能合約
- 節點
- 以太坊公鏈私鏈geth同步
- 比特節點同步
- BTC節點錯誤解決方法
- eth硬分叉
- omni錢包節點搭建
- 架構
- K8s
- 搭建k8s集群完整篇
- 二進制部署k8s
- Devops
- git
- Jenkins
- svn
- 禪道
- CI/CD
- docker+jenkins+golang持續集成持續交付(CI/CD)
- 項目部署
- config.env
- docker-compose.yml
- Dockerfile模板
- .dockerignore
- run.sh
- nginx.conf模板
- 跨域
- jenkins配置
- 測試
- Python