买的是荷兰的VPS, 装了LNMP 1.3,之前建虚拟主机,上传WP建站,一切都正常。。。
+ w% c! j x. q+ T 昨天又买了老外的PHP程序,上传。。。显示安装成功,打开主页却是404错误。。。发TK,提供了FTP。。。回复如下:7 ` a0 z0 A3 O; N* \6 s
3 d9 X0 a6 p8 e4 \
' g* l* C6 G& l2 a! v Hi,+ h0 W; \- H f, E# q
5 c& ?; r8 s4 e, h; y. {" S Seems like you have installed it on nginx, you will need to use these rules to make (程序名字隐藏掉吧) work properly:
! K3 A/ s' O+ E0 C& N: I . m% ^( J& P7 A+ T& r
Just replace root /home/forge/default/public; with path to the script on your server.
( U" j2 {% q) @9 K
+ V5 [, s- \4 ~2 n server {
1 W1 Y4 Z% f7 T U9 T listen 80 default_server;
( `5 F' U- G7 K% d; f server_name default;
* o) K( k0 x% `$ T& r root /home/forge/default/public;6 x% T4 ~0 w6 R
) Q9 y- O3 b( q$ ?( q, M index index.html index.htm index.php;
, j% R1 W3 p& Z( h" L6 ]- F
* I* W4 J7 u y9 D. _ charset utf-8;
& U# s* j# C$ m4 }: M" A# h 4 ^, U$ E9 |# o5 t6 g; C, q
location / {: d9 K. f" U; O- B
try_files $uri $uri/ /index.php?$query_string;
: O; a$ m# H( R$ U: x! X! _ }% |" `7 E3 B6 j) l$ C
: A* ~3 M, y* h6 x! ^ location = /favicon.ico { access_log off; log_not_found off; }. l% Q) Q+ }6 p3 p
location = /robots.txt { access_log off; log_not_found off; }
( G+ X9 |* Y! M 1 v- o' A* X' L; _! [% U, @
access_log off;9 D0 c5 u a1 j/ W [6 I4 e0 T
error_log /var/log/nginx/default-error.log error;; A6 b0 @1 ~/ G. W1 f ` D; H/ p
3 S! e0 d* _9 M( J `" o, I error_page 404 /index.php;0 U1 h" [8 ^ S5 Q
) f' _ A: q+ i0 y
location ~ \.php$ {
9 [' h6 s; B' y+ z, V- U$ U; I fastcgi_split_path_info ^(.+\.php)(/.+)$;- M7 I$ |# V& J
fastcgi_pass unix:/var/run/php5-fpm.sock;6 B8 n4 t# J* X' G, H! p; E% z# F
fastcgi_index index.php;8 p6 c9 i) ]7 ^: B/ w' f; Q
include fastcgi_params;
9 a7 H- P# m' j, c @7 Y) p }# G3 K) U9 u# \* M
5 f1 G, a1 D- Q* Y0 S1 P- J& ? location ~ /\.ht {4 ^/ T* c+ Y( M* h$ W
deny all;
" k' M# V( ?$ w; D1 y3 K* I }
8 x4 g/ \) |8 i# B5 e* X# v } 复制代码 请坛友帮助,具体怎么操作。我链接VPS,上传,修改,用的是 winSCP。。。
* G9 j# g/ G4 a) y7 a. I& I) S3 } ; c. }: L1 n6 S( E
在线等,谢谢!!!
3 G) _0 j/ _. }+ ?- O
相关帖子