내부에서 외부로 Proxy 설정하여 연결하고자 할때 설정
user root root;
worker_processes 3;
events {
worker_connections 1024;
}
http {
include mime.types;
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;
server {
listen 8191 backlog=1024;
server_name localhost;
charset utf-8;
location / {
proxy_pass http://10.10.10.10:1324;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
}
}
server {
listen 8390 backlog=1024;
server_name localhost;
charset utf-8;
location / {
proxy_pass http://10.10.10.10:1325;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
}
}
server {
listen 8610 backlog=1024;
server_name localhost;
charset utf-8;
location / {
proxy_pass http://10.10.10.10:1326;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header Authorization "Basic xxxx"; #password 설정
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
expires -1;
}
}
}
'오픈소스 > nginx' 카테고리의 다른 글
nginx mysql load balancing (0) | 2018.10.05 |
---|---|
nginx 디렉토리 설정예제 (0) | 2018.05.04 |
nginx openresty (0) | 2018.02.07 |
nginx pagespeed (0) | 2018.02.07 |
nginx 서버 파라미터 설정 (0) | 2018.02.07 |