分类

链接

2018 年 5 月
 123456
78910111213
14151617181920
21222324252627
28293031  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > Others, 系统架构, 群晖 > 正文
共享办公室出租
群晖ds photo开启远程访问
Others, 系统架构, 群晖 暂无评论 阅读(753)

ds photo APP在外网无法登陆,是因为DS photo默认是80端口,所以通过5000/5001无法访问,于是需要把80端口下面的这个配置文件放到5000/5001下面,可参考/etc/nginx/nginx.conf,里面有加载 conf.d/*, app.d/*

步骤:

1.在/etc/nginx/conf.d下增加dsm.PhotoStation.conf文件:

  1. location = /photo/csp_report.cgi {
  2.     return 200;
  3. }
  4.  
  5. location = /photo {
  6.     rewrite ^/(.*)$ $1/ permanent;
  7. }
  8.  
  9. location = /blog {
  10.     rewrite ^/(.*)$ $1/ permanent;
  11. }
  12.  
  13. rewrite ^/photo/share/([^/]+)/photo/share.php?shareid=$1;
  14. rewrite ^/photo/share/([^/]+)/(.*)/photo/share.php?shareid=$1>itemid=$2;
  15. rewrite ^/photo/webapi/download\.php/1\.([^?]*)?(.*)/photo/webapi/download.php?$2;
  16. rewrite ^/blog/include/v>dir=([^>]*)>file=(.*)/photo/get_video.php?dir=$1>file=$2;
  17. rewrite ^/blog/(.*)/photo/blog/$1;
  18.  
  19. rewrite ^/~([^\/]*)/photo$ /~$1/photo/ permanent;
  20. rewrite ^/~([^\/]*)/photo/share/([^/]+)/photo/share.php?shareid=$2 last;
  21. rewrite ^/~([^\/]*)/photo/share/([^/]+)/(.*)/photo/share.php?shareid=$2>itemid=$3;
  22. rewrite ^/~([^\/]*)/photo/webapi/download\.php/1\.([^?]*)?(.*)/~$1/photo/webapi/download.php?$3;
  23. rewrite ^/~([^\/]*)/photo/(.*) /photo/$2;
  24.  
  25. rewrite ^/~([^\/]*)/blog$ /~$1/blog/ permanent;
  26. rewrite ^/~([^\/]*)/blog/include/v>dir=([^>]*)>file=(.*)/~$1/photo/get_video.php?dir=$2>file=$3;
  27. rewrite ^/~([^\/]*)/blog/(.*) /photo/blog/$2;
  28.  
  29. location ~ ^/photo/ {
  30.     root /var/packages/PhotoStation/target;
  31.     index index.php;
  32.  
  33.     location ~* \.php(/|$) {
  34.         fastcgi_split_path_info ^(.+?\.php)(.*)$;
  35.  
  36.         fastcgi_param SCRIPT_FILENAME   $document_root$fastcgi_script_name;
  37.         fastcgi_param PATH_TRANSLATED   $document_root$fastcgi_path_info;
  38.         fastcgi_param QUERY_STRING      $query_string;
  39.         fastcgi_param REQUEST_METHOD    $request_method;
  40.         fastcgi_param CONTENT_TYPE      $content_type;
  41.         fastcgi_param CONTENT_LENGTH    $content_length;
  42.  
  43.         fastcgi_param SCRIPT_NAME       $fastcgi_script_name;
  44.         fastcgi_param REQUEST_URI       $request_uri;
  45.         fastcgi_param DOCUMENT_URI      $document_uri;
  46.         fastcgi_param DOCUMENT_ROOT     $document_root;
  47.         fastcgi_param SERVER_PROTOCOL   $server_protocol;
  48.         fastcgi_param HTTPS             $https if_not_empty;
  49.  
  50.         fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  51.         fastcgi_param SERVER_SOFTWARE   nginx/$nginx_version;
  52.  
  53.         fastcgi_param REMOTE_ADDR       $remote_addr;
  54.         fastcgi_param REMOTE_PORT       $remote_port;
  55.         fastcgi_param SERVER_ADDR       $server_addr;
  56.         fastcgi_param SERVER_PORT       $server_port;
  57.         fastcgi_param SERVER_NAME       $host;
  58. # PHP only, required if PHP was built with --enable-force-cgi-redirect
  59.         fastcgi_param REDIRECT_STATUS   200;
  60.         fastcgi_intercept_errors on;
  61.  
  62.         try_files $fastcgi_script_name  =404;
  63.  
  64.         fastcgi_param PATH_INFO $fastcgi_path_info;
  65.         fastcgi_pass unix:/run/php-fpm/php70-fpm.PhotoStation.sock;
  66.  
  67.  
  68.     }
  69. }

 

2.重启nginx

  1. /usr/bin/nginx -s reload

3.安装frp

4.设置开机启动

  1. /usr/local/frp/frpc -/usr/local/frp/frpc.ini

 

 

OK.

 

============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:群晖ds photo开启远程访问 | Bruce's Blog

发表评论

留言无头像?