下載路徑:Nginx下載nginx
下載後解壓以下圖瀏覽器
在nginx目錄下打開命令行工具(可能須要管理員權限)。bash
start nginx : 啓動nginx
nginx -t 測試nginx配置文件是否正確
nginx -s stop :快速中止nginx
nginx -s quit :完整有序的中止nginx
nginx -s reload :修改配置後從新加載生效
nginx -s reopen :從新打開日誌文件
nginx -h : 查看幫助app
>注意:nginx默認監聽80端口,若是80端口已經被使用,則會啓動失敗。能夠設置nginx的監聽端口來解決該問題。tcp
啓動nginx後,可使用命令[nginx -t]或打開瀏覽器[127.0.0.1:port]來檢查是否啓動成功工具
listen:監聽端口
server_name:轉發地址
proxy_pass:代理地址測試
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; 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 / { proxy_pass http://192.168.56.101:7000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } }
持續更新中。。。ui