Setup Nginx as reverse proxy server
#user nobody;
worker_processes 1;
events {
worker_connections 10240;
}
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 Internet_IP:80;
server_name Internet_FQDN;
access_log logs/access.log main;
error_log logs/error.log debug;
rewrite_log on;
root html;
index index.html index.htm;
large_client_header_buffers 4 32k; #added by Stanley 20140415
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_max_temp_file_size 0;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_pass http://internal_IP:7980/;
}
}
}
Reference 1:
http://www.cyberciti.biz/tips/using-nginx-as-reverse-proxy.html
Reference 2:
http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/
worker_processes 1;
events {
worker_connections 10240;
}
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 Internet_IP:80;
server_name Internet_FQDN;
access_log logs/access.log main;
error_log logs/error.log debug;
rewrite_log on;
root html;
index index.html index.htm;
large_client_header_buffers 4 32k; #added by Stanley 20140415
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_max_temp_file_size 0;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_pass http://internal_IP:7980/;
}
}
}
Reference 1:
http://www.cyberciti.biz/tips/using-nginx-as-reverse-proxy.html
Reference 2:
http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/
Comments