当前位置 > it书童 > nginx > 正文

nginx 备忘录

nginx it书童 2019-10-05 11:02:58 0赞 0踩 145阅读 0评论

查找nginx的目录

$ ps -ef | grep nginx
root       493   487  0 Jan26 ?        00:00:00 runsv nginx
root       508   493  0 Jan26 ?        00:00:00 svlogd -tt /var/log/gitlab/nginx
root     11785   493  0 Mar07 ?        00:00:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
gitlab-+ 27309 11785  0 18:50 ?        00:00:00 nginx: worker process
gitlab-+ 27310 11785  0 18:50 ?        00:00:00 nginx: worker process
gitlab-+ 27311 11785  0 18:50 ?        00:00:00 nginx: cache manager process
root     29271 13098  0 18:51 pts/0    00:00:00 grep --color=auto nginx

其中标识为 master 的即为 nginx 目录

上例带有-p参数,在重启nginx时也需要带上此参数

如:

$ /opt/gitlab/embedded/sbin/nginx -t -p /var/opt/gitlab/nginx
nginx: the configuration file /var/opt/gitlab/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /var/opt/gitlab/nginx/conf/nginx.conf test is successful

$ /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx -s reload

增加页面连接时间

nignx与浏览器请求的连接时间是有限制的,如果超时,会报404,可能通过在nginx.conf中增加以下配置,加大连接时间。

# 超时设置
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;

keepalive_timeout  300;
fastcgi_connect_timeout 6000;
fastcgi_send_timeout 6000;
fastcgi_read_timeout 6000;
fastcgi_buffer_size 256k;
fastcgi_buffers 8 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
转载须注明出处:https://www.itshutong.com/articles/265/nginx-memo
关于我
一个文科出身的程序员,追求做个有趣的人,传播有价值的知识,微信公众号主要分享读书思考心得,不会有代码类文章,非程序员的同学请放心订阅
发表评论
我有句话,不知当讲不当讲?
要讲之前请先 登录