安装nginx

yum install nginx 

修改 nginx.conf, (/etc/nginx/nginx.conf), 网上有人做人所有配置项目的详解。

#nu For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx;
worker_processes 8; error_log /var/log/nginx/info.log;
#notic_log /var/log/nginx/notice.log notice;
#info_log /var/log/nginx/info.log info; pid /var/run/nginx.pid;
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 115.159.50.227: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 is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf; }

启动nginx

ngnix

关掉ngnix

kill -HUP `cat /var/run/nginx.pid`

添加动静分离

nginx.conf

最新文章

  1. Addthis
  2. 手机CPU和GPU厂商
  3. ResourceManager里面Trackingui需要手动该ip
  4. android apk静默安装
  5. 山东理工大学第七届ACM校赛-字符的变化 分类: 比赛 2015-06-26 10:32 46人阅读 评论(0) 收藏
  6. windows系统下Python环境的搭建及Selenium的安装
  7. DevExpress控件使用系列--ASPxGridView+Popup+Tab
  8. Android 为应用添加数字角标
  9. .Net Core Identity外面使用Cookie中间件
  10. MySQL学习笔记(四)—存储过程
  11. 港交所OMD-C对接笔记
  12. maven如何修改本地仓库与中央仓库
  13. asp.net core系列 36 WebAPI 搭建详细示例
  14. ios屏幕怎么投屏到电脑显示器
  15. 知名公司的GitHub地址
  16. C++的静态联编和动态联编
  17. Laravel Blade 模板 @section/endsection 与 @section/show, @yield 的区别
  18. python 全栈开发,Day23(复习,isinstance和issubclass,反射)
  19. Asp.Net构架(Http请求处理流程)、(Http Handler 介绍)、(HttpModule 介绍)
  20. 20165336 学习基础与C语言基础调查

热门文章

  1. 疑问,关于win64无法使用debug的问题
  2. 利用JS实现点击按钮后图片自动切换
  3. JS/CSS收藏
  4. easyui datagrid中 多表头方法总结
  5. 小小C程序(九九乘法表)
  6. C语言(Linux)中常用到的函数
  7. runtime第二部分成员变量和属性
  8. Deep Residual Learning
  9. LINQ 函数的实战演练测试
  10. Android学习资料收集