CentOS Build Nginx + Tomcat

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.