Welcome! Log In Create A New Profile

Advanced

答复: static images 404 on Windows

kevin
May 12, 2009 05:42AM
Hi 坏人(Bad guy),
I had translated you mail. Hope it'll help you.


麻烦把你的各种信息发出来
Please send all you configuration detail to me.
包括主目录、各种静态文件的目录结构、以及说明下fastcgi实现的方式。
Including the webroot directory, static files and directory structure, and try to introduce your fastcgi solution.

我的部分配置。基于centos+nginx+apache+php
Hereby my configuration file, based on 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的方式
You can the root directory could be same policy, it’s easy to manipulate, you can try using "try_files" method also.


静态在上面,动态在下面。推荐用X-Real-IP,否则ip就有被人为伪造的可能
Keep the static file policy first, the dynamic request policy below. I suggest using the "X-real-IP" parameter instead of "x-forward-to". Because the "X-forward-to" is easily to fake.

X-Cache是我的习惯,你可以忽略。删掉可以减少几字节,哈哈
I'm used to append "x-cache" header to the response in order to mark this request was hit in cache , you can do it in your way. Delete this line will not cause any subsequences.

我没用fastcgi,你相应的改下就行
I am not using fastcgi solution, you can change it in your way, that fine.

(以上部分配置是从我的一个站点中截取出来的,基于nginx+perl。因内核改了很多,所以不可能全发出来,见谅)
(The configuration I provided is a section from my own site. Based on nginx + perl. I have modified quite a lot of core source of nginx, please forgive me that I can't publish all details of my configuration for security concern)

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

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,1888,1945#msg-1945

BD,
Kevin
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: 60
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