Installing Nginx
Yum Install
Modify Nginx.conf, (/etc/nginx/nginx.conf), online someone to be a man all the configuration of the detailed project.
#nu for more information on configuration, see:# * Official 中文版 documentation:http://nginx.org/en/docs/# * Offici Al Russian Documentation:http://nginx.org/ru/docs/user nginx;worker_processes 8;error_log/var/log/nginx/i Nfo.log, #notic_log/var/log/nginx/notice.log notice; #info_log/var/log/nginx/info.log INFO;PID/VAR/RUN/NGINX.P Id;worker_rlimit_nofile 51200;events {use epoll; Worker_connections 1024;} HTTP {include/etc/nginx/mime.types; Default_type Application/octet-stream; Server_names_hash_bucket_size 128; Client_header_buffer_size 32k; Large_client_header_buffers 4 32k; Client_max_body_size 8m; 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/var/log/nginx/access.log main; Sendfile on; Tcp_nopush on; #keepalive_timeout 0; Keepalive_timeout 65; gzip on; Upstream backend{server localhost:8080; } server{listen 80; server_name www.ppmingpian.cn; Location/{Root/home/nginx/ppmingpian; Index index.htm home.htm; Proxy_redirect off; 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_pass Http://backend; } log_format Access "$remote _addr-$remote _user [$time _local] $request $status $body _bytes_sent $http _referer $http _user_agent $http _x_forwarded_for "; Access_log/var/log/access.log access; # Load config files from the/etc/nginx/conf.d directory # The default server are in conf.d/default.conf include /etc/nginx/conf.d/*.conf;}
Start Nginx
Ngnix
Turn off ngnixkill-hup ' Cat/var/run/nginx.pid '
CentOS Build Nginx + Tomcat