[[Email protected] _ monthly_app001 ~] # Cat/opt/nginx-1.2.9/CONF/nginx. conf
# User nobody;
User Root;
Worker_processes 1;
Worker_cpu_affinity 11111111;
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;
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;
Sendfile on;
# Tcp_nopush on;
# Keepalive_timeout 0;
Keepalive_timeout 65;
Server_tokens off;
# Gzip on;
Server {
Listen 8080;
SERVER_NAME localhost;
# Charset koi8-r;
# Access_log logs/host. Access. Log main;
Location /{
Root HTML;
Index index.html index.htm;
}
Location/spreadmarketcard /{
Proxy_pass http: // 172.16.43.79: 8081/spreadmarketcard /;
Proxy_set_header host $ HOST: 8080;
Proxy_set_header X-real-IP $ remote_addr;
Proxy_set_header X-forwarded-for $ proxy_add_x_forwarded_for;
Proxy_set_header via "nginx ";
}
Location/spreadmarketcardmanager /{
Proxy_pass http: // 172.16.43.79: 8082/spreadmarketcardmanager /;
Proxy_set_header host $ HOST: 8080;
Proxy_set_header X-real-IP $ remote_addr;
Proxy_set_header X-forwarded-for $ proxy_add_x_forwarded_for;
Proxy_set_header via "nginx ";
}
# Error_page 404/404 .html;
# Redirect server error pages to the static page/50x.html
#
Error_page 500 502 503 x.html;
Location =/50x.html {
Root HTML;
}
# Proxy the PHP scripts to Apache listening on 127.0.0.1: 80
#
# Location ~ \. Php $ {
# Proxy_pass http: // 127.0.0.1;
#}
# Pass the PHP scripts to FastCGI server listening on Fig: 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 5 m;
# Ssl_protocols SSLv2 SSLv3 tlsv1;
# Ssl_ciphers high :! Anull :! MD5;
# Ssl_prefer_server_ciphers on;
# Location /{
# Root HTML;
# Index index.html index.htm;
#}
#}
}
[[Email protected] _ monthly_app001 ~] #
Configure JBoss reverse proxy in nginx