亲测:LNMP环境下,解决项目缓冲慢、502以及配置https的问题

在做的项目在nginx下访问缓冲时间过长,明显比apache下访问蛮11倍有余,

解决办法:

 ,分支法解决并发量;

下面把具体解决办法放在下面,顺便把nginx下配置项目的配置贴出来,供大家使用

listen root error_page / location / (!- rewrite ^(.*)$ /index.php?s=$ #location ~ # fastcgi_pass .: location ~ \.php(.* try_files $uri = # fastcgi_pass .: fastcgi_pass .: fastcgi_split_path_info ^((?U).+\.php)(/?.+ }

# HTTPS server

listen root /usr/share/nginx/html/ ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:! ssl_protocols TLSv1 TLSv1. TLSv1. location / root /usr/share/nginx/html/项目名称 (!- rewrite ^(.*)$ /index.php?s=$

          proxy_read_timeout 300;           proxy_connect_timeout 300;           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_redirect off;

          
         location ~ .*\.(php|php5)?               root  /usr/share/nginx/html/项目名称;           
          fastcgi_pass .:10;           fastcgi_index index.php;           fastcgi_param HTTPS on;           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;           include fastcgi_params; # line           include fastcgi.conf;         }      }   强制转成的配置 及访问会自动跳转到对应地址上  server {     listen ;     server_name wx.ssgsrz.com;     rewrite ^/(.*) https:  }

好了  多余的不说了 ,大家复制拿去用就是了

谢谢大家浏览到这里~~~

相关文章

Nginx (engine x) 是一个高性能的HTTP和反向代理服务,也是一...
本地项目配置 1 复制 luffy/settings/dev.py为prop.py 修改l...
nginx不仅可以隐藏版本信息,还支持自定义web服务器信息 先看...
一 、此次漏洞分析 1 nginx HTTP/2漏洞 [nginx-announce] ng...
###进入nginx 目录cd /usr/local/nginx###递归显示 2 级目录...
在cmd命令窗口输入下面命令进行查看 tasklist /fi "ima...