소스 검색

Update fix alias_traversal

Maniack Crudelis 7 년 전
부모
커밋
2d21ec6163
3개의 변경된 파일9개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      conf/nginx.conf
  2. 4 0
      scripts/install
  3. 4 0
      scripts/upgrade

+ 1 - 1
conf/nginx.conf

@@ -1,4 +1,4 @@
-rewrite ^__PATH__$ ^__PATH__/ permanent;
+#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
 location __PATH__/ {
 
   # Path to source

+ 4 - 0
scripts/install

@@ -104,6 +104,10 @@ ynh_setup_source "$final_path"
 #=================================================
 
 # Create a dedicated nginx config
+if [ "$path_url" != "/" ]
+then
+	ynh_replace_string "^#sub_path_only" "" "../conf/nginx.conf"
+fi
 ynh_add_nginx_config
 
 #=================================================

+ 4 - 0
scripts/upgrade

@@ -82,6 +82,10 @@ ynh_setup_source "$final_path"
 #=================================================
 
 # Create a dedicated nginx config
+if [ "$path_url" != "/" ]
+then
+	ynh_replace_string "^#sub_path_only" "" "../conf/nginx.conf"
+fi
 ynh_add_nginx_config
 
 #=================================================