买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。: b, [" ~2 {0 Q. s0 R1 |$ E4 s
昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:% n4 e+ x+ L3 L' u- M
* h g) ]: o) F2 C, D
% ^8 q2 X# @' c( z& g1 W, G
Hi,
6 h4 ]% i1 m7 K . f4 _/ E, g/ y1 c, d6 }: K
Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly:
5 F; g& v: {& A. D! l8 B
# A! q1 j( G g, }# L, S; ? Just replace root /home/forge/default/public; with path to the script on your server.
- E! D2 M; r$ o2 o) z$ X6 g6 C ( |2 _! M8 H+ ~$ T3 s
server {
5 n& E: }6 X9 K6 k listen 80 default_server;
4 k$ H" I; I8 `) W; d) R server_name default;
; o) l y+ D5 H: H root /home/forge/default/public;
% g" O+ E9 }0 }' U9 d8 g
, M! U8 G% W" E" f* v, ] W+ v index index.html index.htm index.php;
" B$ a* [) P1 J5 v
2 N Y S5 Y; L* e# y charset utf-8;8 O6 b9 `1 M u* t5 Z' E
; w& W d1 M& Y' {
location / {6 ]# L$ U( u: W# `0 Y
try_files $uri $uri/ /index.php?$query_string;4 o# ]- A- a1 |1 \
}! b1 B$ r5 b- K( H7 f+ e4 K; p4 t2 k
1 [5 j$ s* r \% y! y
location = /favicon.ico { access_log off; log_not_found off; }) R$ H" m0 L8 B& I- |
location = /robots.txt { access_log off; log_not_found off; }
/ |7 k0 o% X: g$ s# p 9 D! f, T5 Q8 w
access_log off;& ~# Q" g5 U7 C
error_log /var/log/nginx/default-error.log error;
4 c( q" z E' R# ^" U2 d4 D# ~
% [' s. ], `7 q/ E/ i* | error_page 404 /index.php;
5 b" f8 r6 `5 d- H/ h
7 v9 F( f' X+ o1 P! O; b r1 K location ~ \.php$ {: A- _% l# J0 e$ j- _! @2 C' U9 I
fastcgi_split_path_info ^(.+\.php)(/.+)$;8 r6 M; K, E# y, c8 ~2 b8 k# J
fastcgi_pass unix:/var/run/php5-fpm.sock;! d" K( m4 K/ d1 _! m9 q3 E8 x
fastcgi_index index.php;
* Q6 d& x$ e8 T! z: b' ^ include fastcgi_params;1 |- n4 M$ }. ~$ y& u" @! ], o
}
* G" y1 X Y0 h/ ~! I, ?% x& U- L 0 p/ m/ A9 p. g: ?2 M6 j
location ~ /\.ht {
& k! X0 j6 V, \ deny all;
$ m2 X3 _: }7 x# w8 a d3 { }* Q* W' {8 X& k. x- |- s
} 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。5 j& Y/ S: o% v& N# ?
7 a/ w% d& k- }, o" E, a% \7 L
在线等,谢谢!!!7 B9 u0 j9 Z, P+ U% g
相关帖子