国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務(wù)器 > Web服務(wù)器 > 正文

封80端口應(yīng)對策略 Nginx反向代理For WIN2003超級傻瓜式配置

2024-09-01 13:46:01
字體:
供稿:網(wǎng)友

Win下最新版本兒:nginx-0.8.31
下載地址:
下載后解壓到任意位置,然后修改里面的nginx.conf和添加proxy.conf后啟動Nginx.exe即可!

proxy.conf內(nèi)容:

復(fù)制代碼 代碼如下:


proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

client_max_body_size 10m;
client_body_buffer_size 128k;

# client_body_temp_path /var/nginx/client_body_temp;

proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
#proxy_send_lowat 12000;

proxy_buffer_size 32k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;

# proxy_temp_path /var/nginx/proxy_temp;

proxy_ignore_client_abort on;

proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;

proxy_max_temp_file_size 128m;


nginx.conf內(nèi)容:

復(fù)制代碼 代碼如下:


#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;
include proxy.conf;
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 ;
#}

# 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;
# server_name localhost;

# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;

# ssl_session_timeout 5m;

# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;

# location / {
# root html;
# index index.html index.htm;
# }
#}
# 其他的都不用管,只要放對地方就可以,最主要是下面這一行,照著填就可以了!一行一個站,一個站對一個端口,端口不要重復(fù),否則你的IIS內(nèi)的站啟動不了!
server { listen 80; server_name 1.vevb.com; location / { proxy_pass :81; }}
server { listen 80; server_name 2.vevb.com; location / { proxy_pass :82; }}
}


這是代理服務(wù)器上的配置,就是找個沒封80的IP或租個國外的VPS都可以,否則會和你本機已經(jīng)開放的80沖突,然后通過這個代理服務(wù)器跳轉(zhuǎn)到你封80的機器上,封80的機器的站點上添加個空主機頭端口是81即可,這里的81是隨便填的,計算機內(nèi)有655535個端口你可以隨便設(shè)置,這樣封80就在也沒什么用了!

哥再寫個具體傻瓜式操作步驟:
1、上面的軟件下載解壓到你的80沒封的服務(wù)器配置好,這上面最好不要有網(wǎng)站,否則會和你原來的網(wǎng)站用的80沖突;
2、把你的域名解析到上面沒封80的IP上,然后去你封80的機器上把原來的站點上添加個空主機頭端口是81,如:81可以訪問到你的網(wǎng)站上就可以了;
3、Nginx.exe每改一次配置文件需要在任務(wù)管理器內(nèi)結(jié)束任務(wù)后再啟動一次才會生效,是實時生效的!記住兩個Nginx.exe的進(jìn)程都要結(jié)束掉,否則沒用;
4、1.vevb.com這里是換成你的域名的,多個域名用空格分開,沒有限制,一個站一行,不要多個站放在一行;
5、啟Nginx.exe直接雙擊即可,會一閃而過,只要任務(wù)管理器的進(jìn)程里出現(xiàn)兩個Nginx.exe就是正常運行了,否則就是配置文件錯誤沒有啟動;
6、出現(xiàn)504 Gateway Time-out這個錯誤是你的代理服務(wù)器無法訪問:81這個地址,你可以試下,如果你可以服務(wù)器不可以可能和你的防火墻或策略有關(guān);

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 博湖县| 黄冈市| 古浪县| 菏泽市| 葵青区| 游戏| 武汉市| 阳曲县| 临猗县| 仪征市| 绩溪县| 瑞昌市| 鄂尔多斯市| 简阳市| 郴州市| 绥滨县| 通渭县| 监利县| 张掖市| 龙山县| 方山县| 淮滨县| 太仆寺旗| 泸西县| 从化市| 香格里拉县| 枣庄市| 阳山县| 澄江县| 若尔盖县| 西藏| 伊宁市| 黎川县| 南和县| 普宁市| 宁南县| 永宁县| 平顺县| 新平| 平顺县| 彝良县|