买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。
0 u% _/ y+ O4 A 昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:2 {) N7 g1 h; m5 }5 u2 \! y% V
! P6 d: g7 R/ l% J: ^. H7 W9 M' s
" R+ }$ w, u/ [
Hi,
" P, J4 P0 n; M+ ^ . }% I, t. o0 }: x0 ^
Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly: ' L+ y8 g/ @: h" r, A
/ K: k, K" l( q* R& ~
Just replace root /home/forge/default/public; with path to the script on your server.
8 ?& a0 y6 j# Z 7 I8 i T+ f, _- t) C/ t
server {
% s2 F8 c0 b4 n7 Q8 N$ \2 G listen 80 default_server;
$ A8 ?$ a ~4 Q: }' X$ f server_name default;7 z' l$ Z5 Y0 q' ^5 N* c. |1 _2 r
root /home/forge/default/public;
, d& P' P) [% \ E/ C& k
2 a" M1 q( k7 p) V% ] index index.html index.htm index.php;) _6 O4 b- c i j# ~
& N8 A2 h8 S' T+ ?: a
charset utf-8;
) M/ {# X$ F; r* z1 {) Y5 b p
2 W" g6 W6 `, U# } location / {
7 x. _7 m; {& K: ^ try_files $uri $uri/ /index.php?$query_string;8 c; h) q0 }4 h2 n! }+ h
}+ m! f( U" j0 f0 c, p0 I
8 Y/ T, O$ j9 M/ d: L. v location = /favicon.ico { access_log off; log_not_found off; }
# H9 w6 n( F# _* F; c location = /robots.txt { access_log off; log_not_found off; }
_# r3 U" t9 n4 H$ ~& a8 E* i
) t& x4 t0 ] P/ b6 d6 g$ B access_log off;- @" `! V! p* Y& k
error_log /var/log/nginx/default-error.log error;: `+ y1 B2 ^2 i" M0 y5 c4 y
. b E' _& P8 n8 }2 W
error_page 404 /index.php;
$ R0 m( B& R3 |4 J$ q( D5 x+ i * w7 v* g+ f) i K0 E8 S' b4 @2 O
location ~ \.php$ {
3 h4 D9 @2 g7 x& q( h) o fastcgi_split_path_info ^(.+\.php)(/.+)$;
+ @/ M+ d& C l# ^ fastcgi_pass unix:/var/run/php5-fpm.sock;+ {; P- k! y" _
fastcgi_index index.php;2 q7 [) J" f5 b R) n
include fastcgi_params;) a2 O3 g2 ^* f+ U8 l% k
}0 h) ^ Y+ F7 r, I9 l- z
9 R* Y" p. O7 @3 o" w/ n0 u& Z7 T location ~ /\.ht {! {. x9 a3 i% B+ B2 d; A
deny all;5 {! p9 J- c5 j" i' r
}" _+ d, C' r. n) h+ T. A4 ^
} 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。
( O8 N4 s$ o/ ~7 j5 u, ~+ D
1 ]8 s( k4 @3 R: k0 g 在线等,谢谢!!!. R0 \' _. @. l Q7 f. W. c' c
相关帖子