群晖ds photo开启远程访问
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文件:
- location = /photo/csp_report.cgi {
- return 200;
- }
- location = /photo {
- rewrite ^/(.*)$ $1/ permanent;
- }
- location = /blog {
- rewrite ^/(.*)$ $1/ permanent;
- }
- rewrite ^/photo/share/([^/]+)$ /photo/share.php?shareid=$1;
- rewrite ^/photo/share/([^/]+)/(.*)$ /photo/share.php?shareid=$1>itemid=$2;
- rewrite ^/photo/webapi/download\.php/1\.([^?]*)?(.*)$ /photo/webapi/download.php?$2;
- rewrite ^/blog/include/v>dir=([^>]*)>file=(.*)$ /photo/get_video.php?dir=$1>file=$2;
- rewrite ^/blog/(.*)$ /photo/blog/$1;
- rewrite ^/~([^\/]*)/photo$ /~$1/photo/ permanent;
- rewrite ^/~([^\/]*)/photo/share/([^/]+)$ /photo/share.php?shareid=$2 last;
- rewrite ^/~([^\/]*)/photo/share/([^/]+)/(.*)$ /photo/share.php?shareid=$2>itemid=$3;
- rewrite ^/~([^\/]*)/photo/webapi/download\.php/1\.([^?]*)?(.*)$ /~$1/photo/webapi/download.php?$3;
- rewrite ^/~([^\/]*)/photo/(.*) /photo/$2;
- rewrite ^/~([^\/]*)/blog$ /~$1/blog/ permanent;
- rewrite ^/~([^\/]*)/blog/include/v>dir=([^>]*)>file=(.*)$ /~$1/photo/get_video.php?dir=$2>file=$3;
- rewrite ^/~([^\/]*)/blog/(.*) /photo/blog/$2;
- location ~ ^/photo/ {
- root /var/packages/PhotoStation/target;
- index index.php;
- location ~* \.php(/|$) {
- fastcgi_split_path_info ^(.+?\.php)(.*)$;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- fastcgi_param SCRIPT_NAME $fastcgi_script_name;
- fastcgi_param REQUEST_URI $request_uri;
- fastcgi_param DOCUMENT_URI $document_uri;
- fastcgi_param DOCUMENT_ROOT $document_root;
- fastcgi_param SERVER_PROTOCOL $server_protocol;
- fastcgi_param HTTPS $https if_not_empty;
- fastcgi_param GATEWAY_INTERFACE CGI/1.1;
- fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
- fastcgi_param REMOTE_ADDR $remote_addr;
- fastcgi_param REMOTE_PORT $remote_port;
- fastcgi_param SERVER_ADDR $server_addr;
- fastcgi_param SERVER_PORT $server_port;
- fastcgi_param SERVER_NAME $host;
- # PHP only, required if PHP was built with --enable-force-cgi-redirect
- fastcgi_param REDIRECT_STATUS 200;
- fastcgi_intercept_errors on;
- try_files $fastcgi_script_name =404;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- fastcgi_pass unix:/run/php-fpm/php70-fpm.PhotoStation.sock;
- }
- }
2.重启nginx
- /usr/bin/nginx -s reload
3.安装frp
4.设置开机启动
- /usr/local/frp/frpc -c /usr/local/frp/frpc.ini
OK.