VPS侦探论坛

 找回密码
 注册
查看: 3866|回复: 3

军哥,如和让如下这个虚拟目录支持图片访问?谢谢

[复制链接]
发表于 2016-4-10 10:00:18 | 显示全部楼层 |阅读模式

  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name files.abc.com;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /www/wwwroot/abc;
  8.        
  9.         location /file_images/article/{
  10.         alias /www/wwwroot/abc/d/file/;
  11.         }

  12.         include none.conf;
  13.         #error_page   404   /404.html;
  14.         location ~ [^/]\.php(/|$)
  15.         {
  16.             # comment try_files $uri =404; to enable pathinfo
  17.             try_files $uri =404;
  18.             fastcgi_pass  unix:/tmp/php-cgi.sock;
  19.             fastcgi_index index.php;
  20.             include fastcgi.conf;
  21.             #include pathinfo.conf;
  22.         }

  23.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  24.         {
  25.             expires      30d;
  26.         }

  27.         location ~ .*\.(js|css)?$
  28.         {
  29.             expires      12h;
  30.         }

  31.         access_log off;
  32.     }
复制代码

军哥,如和让如下这个虚拟目录支持图片访问?谢谢,我是刚接触,都是看的教程,这个实在是没有办法,
这个虚拟目录是用来链接附件的
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-4-10 10:28:00 | 显示全部楼层


谁给我说一下 谢谢!!!
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2016-4-10 14:01:05 | 显示全部楼层

location ^~ /file_images/article/ {
        alias /www/wwwroot/abc/d/file/;
        }
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-4-11 15:11:07 | 显示全部楼层



谢谢军哥,按照你说的 可以了!
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-29 03:25 , Processed in 0.025826 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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