fastcgi

Nginx配置详解

前提是你 提交于 2021-02-11 15:58:24
# nginx进程,一般设置为和cpu核数一样 worker_processes 4 ; # 错误日志存放目录 error_log /data1/logs/ error.log crit; # 运行用户,默认即是nginx,可不设置 user nginx # 进程pid存放位置 pid /application/nginx/ nginx.pid; # Specifies the value for maximum file descriptors that can be opened by this process. # 最大文件打开数(连接),可设置为系统优化后的ulimit -HSn的结果 worker_rlimit_nofile 51200 ; cpu亲和力配置,让不同的进程使用不同的cpu worker_cpu_affinity 0001 0010 0100 1000 0001 00100100 1000 ; # 工作模式及连接数上限 events { use epoll; # epoll是多路复用IO(I/O Multiplexing)中的一种方式,但是仅用于linux2.6以上内核,可以大大提高nginx的性能 worker_connections 1024; # ;单个后台worker process进程的最大并发链接数 } # ###################

add security headers in NGINX while using fastcgi caching

纵然是瞬间 提交于 2021-02-11 14:11:04
问题 I am using nginx with fastcgi cache. I want to use security headers on my site. I have already added add header field in my virtual host configurations but I can not get any headers unless I disable add_header X-fastcgi cache $upstream cache status in my fastcgi_main.conf file. virualhost file : } include /etc/nginx/bots.d/blockbots.conf; include /etc/nginx/bots.d/ddos.conf; include /etc/nginx/skip_cache.conf ; include /etc/nginx/purge_location.conf ; include /etc/nginx/gzip_location.conf ;

nginx + fastCGI for PHP error_page

隐身守侯 提交于 2021-02-10 07:06:48
问题 I set up custom error pages in nginx with fastCGI for PHP like this way and it works: root <FOLDER>; error_page 404 /error.php?404; location = /error.php { include /etc/nginx/fastcgi.conf; fastcgi_pass 127.0.0.1:1234; root <FOLDER>; } But since I have one error.php for every HTTP error codes, I wanted to set up in a general form. The problem is that I don't know if nginx provide the error code to be passed by GET to error.php I am looking for something like: root <FOLDER>; error_page 500 501

nginx + fastCGI for PHP error_page

帅比萌擦擦* 提交于 2021-02-10 07:05:03
问题 I set up custom error pages in nginx with fastCGI for PHP like this way and it works: root <FOLDER>; error_page 404 /error.php?404; location = /error.php { include /etc/nginx/fastcgi.conf; fastcgi_pass 127.0.0.1:1234; root <FOLDER>; } But since I have one error.php for every HTTP error codes, I wanted to set up in a general form. The problem is that I don't know if nginx provide the error code to be passed by GET to error.php I am looking for something like: root <FOLDER>; error_page 500 501

FastCGI

一曲冷凌霜 提交于 2021-02-09 04:50:51
  CGI全程“通用网关接口”,它可以让一个客户端从网页浏览器向执行在Web服务器上的程序请求数据,CGI描述了客户端和这个程序之间传输数据的一种标准。   FastCGI是Web服务器和处理程序之间通信的一种协议,是CGI的一种改进,FastCGI类似一个常驻性的CGI,它可以一直执行,在请求到达时不会花费时间去fork一个进程进来处理。因为他只是一个通信协议,且支持分布式的运算,即FastCGI程序可以在网站服务器以外的主机上执行并接受且接受来自其他网站服务器的请求。   FastCGI是与语言无关的、可伸缩架构的CGI开发扩展,将CGI解释器进程保持在内存当中,可以获得较高的性能。CGI程序反复加载是CGI性能地下的主要原因,如果CGI程序保持在内存中并接收FastCGI进程管理器的调度,则可以提供良好的性能、伸缩性等。   FastCGI大致工作流程:   ①Web Service在启动时加载FastCGI进程管理器;   ②FastCGI进程管理器自身初始化,启动多个CGI解释器进程(可见多个php-cgi)并等待来自Web Service的连接;   ③当客户端请求到达Web Service时,FastCGI进程管理器选择并链接到一个CGI解释器。Web Service 将CGI环境变量和标准输入发送到FastCGI进程php-cgi  

记一次全站升级https引发的一系列问题

那年仲夏 提交于 2021-02-08 05:30:39
中秋假期,闲来无事。花了一下午折腾了下https,说实话这年头还有网站不上https显然是折腾精神不够啊~ 1、SSL证书评估 看了市面上各种类型的证书,有收费的也有免费的,但是最终还是选择了腾讯云提供的TrustAsia一年免费期的证书,没有次数限制,可以过期后再次申请。最主要的原因还是我懒,哈哈~~ 2、SSL证书安装 从腾讯云将申请的证书下载到本地,解压获得3个文件夹,分别是Apache、IIS、Nginx 服务器的证书文件,可以根据自己的实际情况,安装在三种服务器上。 我这里使用Nginx做前端转发。更多的介绍可以查看文档:https://cloud.tencent.com/document/product/400/4143 2.1 获取证书 Nginx文件夹内获得SSL证书文件 1_www.domain.com_bundle.crt 和私钥文件 2_www.domain.com.key, 1_www.domain.com_bundle.crt 文件包括两段证书代码 “-----BEGIN CERTIFICATE-----”和“-----END CERTIFICATE-----”, 2_www.domain.com.key 文件包括一段私钥代码“-----BEGIN RSA PRIVATE KEY-----”和“-----END RSA PRIVATE KEY-----”。

nginx高性能WEB服务器系列之一简介及安装

五迷三道 提交于 2021-02-07 22:52:27
nginx系列友情链接: nginx高性能WEB服务器系列之一简介及安装 https://www.cnblogs.com/maxtgood/p/9597596.html nginx高性能WEB服务器系列之二命令管理 https://www.cnblogs.com/maxtgood/p/9597990.html nginx高性能WEB服务器系列之三版本升级 https://www.cnblogs.com/maxtgood/p/9598113.html nginx高性能WEB服务器系列之四配置文件详解 https://www.cnblogs.com/maxtgood/p/9598333.html nginx高性能WEB服务器系列之五--实战项目线上nginx多站点配置 https://www.cnblogs.com/maxtgood/p/9598610.html nginx高性能WEB服务器系列之六--nginx负载均衡配置+健康检查 https://www.cnblogs.com/maxtgood/p/9599068.html nginx高性能WEB服务器系列之七--nginx反向代理 https://www.cnblogs.com/maxtgood/p/9599335.html nginx高性能WEB服务器系列之八--nginx日志分析与切割 https://www.cnblogs

Script timed out before returning headers: php.fastcgi

删除回忆录丶 提交于 2021-02-07 03:43:04
问题 After about 90 seconds I see this error in my apache error log. I'm assusming I need to increase a setting in PHP but I'm not sure which one to change. Is there one setting I can increase to clear this error? 回答1: Find in your php.ini file something like this: ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 600 ; Maximum amount of time each script may spend parsing request

Script timed out before returning headers: php.fastcgi

与世无争的帅哥 提交于 2021-02-07 03:42:45
问题 After about 90 seconds I see this error in my apache error log. I'm assusming I need to increase a setting in PHP but I'm not sure which one to change. Is there one setting I can increase to clear this error? 回答1: Find in your php.ini file something like this: ; Maximum execution time of each script, in seconds ; http://php.net/max-execution-time ; Note: This directive is hardcoded to 0 for the CLI SAPI max_execution_time = 600 ; Maximum amount of time each script may spend parsing request

安装与配置Nginx

浪尽此生 提交于 2021-02-06 09:00:58
1.Nginx依赖程序安装 [root@Linux tool]# yum -y install zlib pcre pcre-devel openssl openssl-devel gcc-c++ 2.源码编译安装Nginx #useradd -s /sbin/nologin www [root@Linux tool]# wget -c http://nginx.org/download/nginx-1.14.2.tar.gz [root@Linux tool]# tar zxvf nginx-1.14.2.tar.gz [root@Linux tool]# cd nginx-1.14.2 [root@Linux nginx-1.14.2]# ./configure --user=www --group=www --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf- path=/usr/local/nginx/conf/nginx.conf --error-log-path=/usr/local/nginx/logs/error.log --http-log-path=/usr/local/nginx/logs/access.log --pid-path=/var/run/nginx.pid