Welcome! Log In Create A New Profile

Advanced

Re: static images 404 on Windows

May 12, 2009 03:56AM
麻烦把你的各种信息发出来
包括主目录、各种静态文件的目录结构、以及说明下fastcgi实现的方式。

我的部分配置。基于centos+nginx+apache+php
server {
listen 80;
server_name www.abc.com;
index index.htm index.php;
root /data/sites;

location ~* ^.+\.(jpg|jpeg|gif|png|js|css|swf)$ {
valid_referers none blocked server_names *.abc.com;
if ($invalid_referer) {
return 403;
}
expires 1d;
add_header X-Cache HIT;
root /static/abc;
}


location / {
proxy_pass http://127.0.0.1:81;
proxy_redirect off;
proxy_set_header isme "huairen";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

主目录和静态文件可以相同可以不同,diy很强。还可以用try_files的方式
静态在上面,动态在下面。推荐用X-Real-IP,否则ip就有被人为伪造的可能
X-Cache是我的习惯,你可以忽略。删掉可以减少几字节,哈哈
我没用fastcgi,你相应的改下就行
(以上部分配置是从我的一个站点中截取出来的,基于nginx+perl。因内核改了很多,所以不可能全发出来,见谅)

btw:you should learn more foreign languages. for better use of nginx, i even had self-russian
Subject Author Posted

static images 404 on Windows

Chris Cortese May 09, 2009 04:25AM

Re: static images 404 on Windows

坏人 May 11, 2009 11:31PM

Re: static images 404 on Windows

Chris Cortese May 11, 2009 11:51PM

Re: static images 404 on Windows

raptium May 12, 2009 12:04AM

Re: static images 404 on Windows

Chris Cortese May 12, 2009 12:17AM

Re: static images 404 on Windows

凌晨 May 11, 2009 11:57PM

Re: static images 404 on Windows

raptium May 12, 2009 12:30AM

Re: static images 404 on Windows

Chris Cortese May 12, 2009 12:36AM

Re: static images 404 on Windows

Igor Sysoev May 12, 2009 02:13AM

Re: static images 404 on Windows

Chris Cortese May 12, 2009 03:16AM

Re: static images 404 on Windows

Igor Sysoev May 12, 2009 03:18AM

Re: static images 404 on Windows

Chris Cortese May 14, 2009 05:58PM

Re: static images 404 on Windows

Igor Sysoev May 15, 2009 01:10AM

Re: static images 404 on Windows

坏人 May 12, 2009 03:56AM

Re: static images 404 on Windows

Igor Sysoev May 12, 2009 04:15AM

答复: static images 404 on Windows

kevin May 12, 2009 05:42AM

windows static assets - solved

Chris Cortese May 14, 2009 09:33PM

Re: windows static assets - solved

Igor Sysoev May 15, 2009 01:13AM

Re: windows static assets - solved

Chris Cortese May 15, 2009 02:39AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready