文心思匠

吸收那些用得着的东西,拒绝那些用不着的东西,增加那些自己所特有的东西

桃之夭夭,灼灼其华。之子于归,宜其室家。桃之夭夭,有蕡其实。之子于归,宜其家室。

解决iframe、frame和框架丢失或获取不到session、cookies问题

原因: nginx反向代理丢失cookie的问题1. 只有host、端口变化,则cookie不会丢失。如:location /blog {    proxy_pass http://127.0.0.1:9001/blog;}2. 如果路径也变化了,则需要设置cookie的路径转换如:location /proxy_path {    proxy_pass http://127.0.0.1:9001/;    proxy_set_header X-real-ip $remote_addr;}3. 通过浏览器访问http://127.0. 继续阅读

nginx command not found

-bash: nginx: command not found在Centos中无法在任意路径中执行nginx命令,需进入nginx目录才可以执行,解决方案是:在/etc/profile中增加nginx的执行路径的环境变量添加nginx环境变量vim /etc/profile# 增加nginx的执行文件路径# nginxexport PATH="/usr/local/nginx/sbin:$PATH"# 保存环境变量source /etc/profile验证nginx.conf配置nginx -t无痛重启nginxnginx -s reload 继续阅读