您现在的位置是:首页 >其他 >nginx实现正向代理网站首页其他
nginx实现正向代理
1.下载nginx

选择自己需要的版版本下载下来
2.解压文件修改ngixn.conf配置文件

events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;sendfile on;
keepalive_timeout 65;server {
listen 9000;
server_name localhost;
client_max_body_size 50M;
location / {
proxy_pass http://172.16.1.3:9000;
proxy_set_header X-real-ip $remote_addr;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
3.点击nginx.exe启动

或者打开nginx的目录输入cmd回车

输入start nginx

4.常用命令
windows
服务启动
linux根据配置文件启动
./nginx -c /usr/local/nginx/conf/nginx.conf
window在cmd中启动
start nginx
服务停止
#立即停止
nginx -s stop
或者
平滑停止
nginx -s quit
服务重启
nginx -s reload
linux
启动 Nginx
./nginx
停止 Nginx
./nginx -s stop
安全退出 Nginx
./nginx -s quit
重新加载 Nginx 配置文件
./nginx -s reload
查看 Nginx 进程
ps aux|grep nginx





U8W/U8W-Mini使用与常见问题解决
QT多线程的5种用法,通过使用线程解决UI主界面的耗时操作代码,防止界面卡死。...
stm32使用HAL库配置串口中断收发数据(保姆级教程)
分享几个国内免费的ChatGPT镜像网址(亲测有效)
Allegro16.6差分等长设置及走线总结