VPS侦探论坛

 找回密码
 注册
查看: 8350|回复: 4

301后一个很奇怪的问题,地址尾部加“/”与否会导致子目录路径错误 标题长一点 实在太奇怪了!

[复制链接]
发表于 2011-8-17 23:44:03 | 显示全部楼层 |阅读模式

标题长了点,呵呵
还请能进来本帖的朋友帮忙分析一下
访问
http://1986y.net/phpmyadmin

http://1986y.net/phpmyadmin/
是两个完全不同的效果 后面加上/才能正常的访问 不加/虽然也可以 但是本应该在子目录里的路径 统统都会到父目录里
这个有点抽象是吧?大家点一下地址就知道了
当我单独用IP地址访问的时候 加或者不加/在地址后面 效果是一样的
大家可以对比一下
http://174.139.84.98/phpmyadmin

http://174.139.84.98/phpmyadmin/

这样就是没区别的

这是为什么呢?是不是/usr/local/nginx/conf/vhost/1986y.net.conf的配置文件有问题呢?

我贴一下..大家帮忙看看
  1. server
  2. {
  3. listen 80;
  4. server_name 1986y.net;
  5. index index.html index.htm index.php default.html default.htm default.php;
  6. root /home/wwwroot/1986y;

  7. include wordpress.conf;
  8. location ~ .*\.(php|php5)?$
  9. {
  10. fastcgi_pass unix:/tmp/php-cgi.sock;
  11. fastcgi_index index.php;
  12. include fcgi.conf;
  13. }

  14. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  15. {
  16. expires 30d;
  17. }

  18. location ~ .*\.(js|css)?$
  19. {
  20. expires 12h;
  21. }

  22. log_format 1986y.net '$remote_addr - $remote_user [$time_local] $request '
  23. '$status $body_bytes_sent $http_referer '
  24. '$http_user_agent $http_x_forwarded_for';
  25. access_log /home/wwwlogs/1986y.net.log 1986y.net;
  26. }
复制代码

[ 本帖最后由 farmer6 于 2011-8-17 23:49 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-8-17 23:45:19 | 显示全部楼层


我的是www.1986y.net地址301到1986y.net上
我给www.1986y.net.conf的配置信息也贴一下


  1. server {
  2.                 listen       80;
  3.                 server_name www.1986y.net;
  4.                 index index.html index.htm index.php default.html default.htm default.php;
  5.                 root  /home/wwwroot/1986y;
  6.                 include none.conf;
  7.                 location ~ .*\.(php|php5)?$
  8.                         {
  9.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  10.                                 fastcgi_index index.php;
  11.                                 include fcgi.conf;
  12.                         }
  13.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  14.                         {
  15.                                 expires      30d;
  16.                         }
  17.                 location ~ .*\.(js|css)?$
  18.                         {
  19.                                 expires      12h;
  20.                         }
  21.                 access_log off;
  22.         }
  23. server {
  24.                 listen       80;
  25.                 server_name www.1986y.net;
  26.                 if ($host != '1986y.net' ) {
  27.                 rewrite ^/(.*)$ http://1986y.net/$1 permanent;
  28.                 }

复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2011-8-18 09:26:21 | 显示全部楼层
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-8-18 17:39:35 | 显示全部楼层



感谢军哥回复
但是我修改后 还是不行 reload和restart lnmp后到不行 我reboot服务器也是一样 求解..
  1. user  www www;

  2. worker_processes 1;

  3. error_log  /home/wwwlogs/nginx_error.log  crit;

  4. pid        /usr/local/nginx/logs/nginx.pid;

  5. #Specifies the value for maximum file descriptors that can be opened by this process.
  6. worker_rlimit_nofile 51200;

  7. events
  8.         {
  9.                 use epoll;
  10.                 worker_connections 51200;
  11.         }

  12. http
  13.         {
  14.                 include       mime.types;
  15.                 default_type  application/octet-stream;

  16.                 server_names_hash_bucket_size 128;
  17.                 server_name_in_redirect off;
  18.                 client_header_buffer_size 32k;
  19.                 large_client_header_buffers 4 32k;
  20.                 client_max_body_size 50m;

  21.                 sendfile on;
  22.                 tcp_nopush     on;

  23.                 keepalive_timeout 60;

  24.                 tcp_nodelay on;

  25.                 fastcgi_connect_timeout 300;
  26.                 fastcgi_send_timeout 300;
  27.                 fastcgi_read_timeout 300;
  28.                 fastcgi_buffer_size 64k;
  29.                 fastcgi_buffers 4 64k;
  30.                 fastcgi_busy_buffers_size 128k;
  31.                 fastcgi_temp_file_write_size 256k;

  32.                 gzip on;
  33.                 gzip_min_length  1k;
  34.                 gzip_buffers     4 16k;
  35.                 gzip_http_version 1.0;
  36.                 gzip_comp_level 2;
  37.                 gzip_types       text/plain application/x-javascript text/css application/xml;
  38.                 gzip_vary on;

  39.                 #limit_zone  crawler  $binary_remote_addr  10m;

  40. server
  41.         {
  42.                 listen       80;
  43.                 server_name 174.139.84.99;
  44.                 index index.html index.htm index.php;
  45.                 root  /home/wwwroot;

  46.                 location ~ .*\.(php|php5)?$
  47.                         {
  48.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  49.                                 fastcgi_index index.php;
  50.                                 include fcgi.conf;
  51.                         }

  52.                 location /status {
  53.                         stub_status on;
  54.                         access_log   off;
  55.                 }

  56.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  57.                         {
  58.                                 expires      30d;
  59.                         }

  60.                 location ~ .*\.(js|css)?$
  61.                         {
  62.                                 expires      12h;
  63.                         }

  64.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  65.              '$status $body_bytes_sent "$http_referer" '
  66.              '"$http_user_agent" $http_x_forwarded_for';
  67.                 access_log  /home/wwwlogs/access.log  access;
  68.         }
  69. include vhost/*.conf;

  70. }
复制代码
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2011-8-22 18:18:12 | 显示全部楼层

顶上去 ......

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-21 04:27 , Processed in 0.026598 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表