php 交给apache 处理了
静态文件交给了 nginx
碰到的问题 用户目录如何映射
location ~ ^/~(.+?)(/.*?)$ {
//该匹配有问题,无法匹配根级目录/~peach 这样的匹配将会失效,修改成 ^/~([^/]+)(.*)$
alias /home/$1/public_html$2;
index index.html index.htm index.php;
}
ok
apache 代理部分
78 location ~ ^(.+\.php)(.*)$ {
79 proxy_redirect off;
80 proxy_set_header HOST $host;
81 proxy_set_header SERVER_ADDR $server_addr;
82 proxy_set_header SERVER_PORT $server_port;
83 proxy_set_header REMOTE_ADDR $remote_addr;
84 proxy_set_header REMOTE_PORT $remote_port;
85 proxy_pass http://127.0.0.1:8080;
86 }
目录自己追加斜线部分
43 location / {
44 #root html;
45 #autoindex on;
46 if (-d $request_filename) {
47 rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
48 }
49 index index.html index.htm index.php;
50 }
对后缀名是图片的文件追加客户端缓存时间
58 location ~* \.(js|css|jpg|jpeg|gif|png)$ {
59 access_log off;
60 expires 1d;
61 }
62
如果需要开启类似apache的文件列表功能
autoindex on