Nginx

分类下相关文章

Nginx user 配置引发的血案

在折腾完了 gulp livereload web server 之后,我才发现其实 Nginx 才是最靠谱的 web 调试服务。 毕竟写伪接口用 Nginx 要方便的多,也不用考虑 node 模块的一堆奇葩依赖。 但是 Nginx 也让我吐了一口血。白天在公司 Ubuntu 开发机上一切正常,但是回家后发现 Mac 下的 Nginx 一直报错。 stat() "/Users/zhongwei/test/index.html" failed (13: Permission denied), rewrite or internal redirection cycle whi ...

阅读全文...

Nginx 日志解析

Nginx 日志默认的格式 一条日志 192.34.61.118 - - [15/Jan/2015:16:03:46 +0800] "GET /parse-nginx-log-with-awk.html HTTP/1.1" 200 2148 "http://sunzhongwei.com" "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)" 对应的格式 $remote_addr - - [$time_local] "$requ ...

阅读全文...

使用 Nginx 限制页面访问权限

写了一个小 web 应用,需要后台提交数据,但是这个页面只允许我一个人访问。 单独为这个页面增加用户权限系统,有点杀鸡用牛刀的感觉。还好用 Nginx 可以轻松搞定这件事。 htpasswd htpasswd is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users. 安装方法 sudo apt-get install apache2-utils 创建用户和密码 $ sudo htpasswd -c /etc/n ...

阅读全文...

nginx

参考 Nginx开发从入门到精通 uwsgi timeout nginx 的配置更新: uwsgi_read_timeout 300; 默认为 60 秒,容易会超时。 uWSGI 的日志中会看到以下错误 write(): Broken pipe [plugins/python/wsgi_subhandler.c line 132] writev(): Broken pipe [plugins/python/wsgi_headers.c line 205] uwsgi read timeout user www-data; 格式 user user_name group_name; ...

阅读全文...