nginx.config
在 todo标记的地方修改ip或删除
#user nobody;
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;
# 80 端口转发 todo
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
# 8020 端口转发 todo
server {
listen 8020;
server_name localhost;
location / {
proxy_pass http://192.168.21.45:8080;
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-Forwarded-Proto $scheme;
}
}
}
stream {
# 数据库代理 todo
server {
listen 1521;
proxy_pass 192.168.21.45:1521 ;
}
# ssh端口转发 todo
server {
listen 22 ;
proxy_pass 192.168.21.46:22 ;
}
# windows 端口转发 todo
server {
listen 33891;
proxy_pass 192.168.21.45:3389 ;
}
}