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