1奔脐,修改nginx.conf
#user nobody;
worker_processes 4;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
worker_rlimit_nofile 65535;
events {
worker_connections 65535;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] $host "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
server_tokens off;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
upstream count_boss {
server 192.168.8.236:3480;
}
server {
listen 9191;
server_name 192.168.8.47;
#charset koi8-r;
access_log logs/host.access.log;
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;
}
# count_boss
location /boss/ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
proxy_set_header Cookie $http_cookie;
client_max_body_size 50m;
client_body_buffer_size 256k;
proxy_connect_timeout 75;
proxy_send_timeout 120;
proxy_read_timeout 300;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
# proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_pass http://count_boss/boss/; #請(qǐng)求轉(zhuǎn)向定義的服務(wù)器列表
}
# 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;
# }
#}
}
2辫诅,nginx命令
## 關(guān)閉nginx
nginx -s stop
## 關(guān)閉nginx
taskkill /F /IM nginx.exe > null
## 查看nginx
tasklist /fi "imagename eq nginx.exe"
## 測(cè)試nginx.conf正確性
nginx.exe –t
## start.bat
C:
cd C:\Users\lixj\Desktop\nginx-1.12.0
start nginx
## stop.bat
C:
cd C:\Users\lixj\Desktop\nginx-1.12.0
taskkill /F /IM nginx.exe>nul
## reload.bat
C:
cd C:\Users\lixj\Desktop\nginx-1.12.0
nginx -s reload
## 分享下bat文件
====================================================
@echo off
rem 當(dāng)前bat的作用
echo ==================begin========================
cls
SET NGINX_PATH=C:
SET NGINX_DIR=C:\Users\lixj\Desktop\nginx-1.12.0\
color 0a
TITLE Nginx 管理程序控制面板
CLS
ECHO.
ECHO. * Nginx Manage System *
ECHO. * Author lixj *
ECHO. * Date 2017-05-19 *
ECHO.
:MENU
ECHO. * nginx process list *
tasklist|findstr /i "nginx.exe"
ECHO.
ECHO. [1] 啟動(dòng)Nginx
ECHO. [2] 關(guān)閉Nginx
ECHO. [3] 重啟Nginx
ECHO. [4] 退 出
ECHO.
ECHO.請(qǐng)輸入選擇項(xiàng)目的序號(hào):
set /p ID=
IF "%id%"=="1" GOTO start
IF "%id%"=="2" GOTO stop
IF "%id%"=="3" GOTO restart
IF "%id%"=="4" EXIT
PAUSE
:start
call :startNginx
GOTO MENU
:stop
call :shutdownNginx
GOTO MENU
:restart
call :shutdownNginx
call :startNginx
GOTO MENU
:shutdownNginx
ECHO.
ECHO.關(guān)閉Nginx......
taskkill /F /IM nginx.exe > nul
ECHO.OK,關(guān)閉所有nginx 進(jìn)程
goto :eof
:startNginx
ECHO.
ECHO.啟動(dòng)Nginx......
IF NOT EXIST "%NGINX_DIR%nginx.exe" ECHO "%NGINX_DIR%nginx.exe"不存在
%NGINX_PATH%
cd "%NGINX_DIR%"
IF EXIST "%NGINX_DIR%nginx.exe" (
echo "start '' nginx.exe"
start "" nginx.exe
)
ECHO.OK
goto :eof
Nginx的使用
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
- 文/潘曉璐 我一進(jìn)店門(mén),熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)竞川,“玉大人店溢,你說(shuō)我怎么就攤上這事委乌。” “怎么了遭贸?”我有些...
- 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我除秀,道長(zhǎng)算利,這世上最難降的妖魔是什么? 我笑而不...
- 正文 為了忘掉前任效拭,我火速辦了婚禮,結(jié)果婚禮上缎患,老公的妹妹穿的比我還像新娘。我一直安慰自己挤渔,他們只是感情好肮街,可當(dāng)我...
- 文/花漫 我一把揭開(kāi)白布嫉父。 她就那樣靜靜地躺著,像睡著了一般眼刃。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上擂红,一...
- 那天,我揣著相機(jī)與錄音昵骤,去河邊找鬼。 笑死涉茧,一個(gè)胖子當(dāng)著我的面吹牛赴恨,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播伴栓,決...
- 文/蒼蘭香墨 我猛地睜開(kāi)眼伦连,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了钳垮?” 一聲冷哼從身側(cè)響起惑淳,我...
- 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎饺窿,沒(méi)想到半個(gè)月后歧焦,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
- 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
- 正文 我和宋清朗相戀三年绢馍,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了向瓷。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
- 正文 年R本政府宣布,位于F島的核電站搁痛,受9級(jí)特大地震影響长搀,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜鸡典,卻給世界環(huán)境...
- 文/蒙蒙 一源请、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧轿钠,春花似錦巢钓、人聲如沸。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至贷腕,卻和暖如春背镇,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背泽裳。 一陣腳步聲響...
- 正文 我出身青樓胸囱,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親瀑梗。 傳聞我的和親對(duì)象是個(gè)殘疾皇子烹笔,可洞房花燭夜當(dāng)晚...
推薦閱讀更多精彩內(nèi)容
- **包括以下幾點(diǎn): ** nginx location nginx upstream nginx proxy pa...
- 一、安裝 分別執(zhí)行以下命令: $ sudo apt-get update $ sudo apt-get insta...
- 在學(xué)校學(xué)美術(shù)的時(shí)候,為了練好畫(huà)亿鲜,也曾畫(huà)了很多的速寫(xiě)允蜈。也臨摹過(guò)很多大師的作品。尤其喜歡安格爾大師的畫(huà),推薦喜...
- 這是Ranks的職場(chǎng)學(xué)習(xí)日記的第001篇原創(chuàng)文章 程序員可以說(shuō)是一個(gè)既高大上又屌絲的職業(yè)仔引! 高大上表現(xiàn)在工作于商業(yè)...