메뉴 건너뛰기

하위 디렉토리 rewrite 적용 문의

nginx 루트에서 하위 xe3 디렉토리를 만든 다음 설치하였습니다.

rewrite는 루트기준인거 같아 아래와 같이 수정하여 적용하였습니다.

 

####### XE3 rewrite ######
        location /xe3/ {
                try_files $uri $uri/ /xe3/index.php?$args;
                rewrite ^.* /xe3/index.php;
        }

        location ~ /\.  {
                deny all;
        }

        location ^~ /xe3/assets/ {
                try_files $uri /xe3/index.php?$args;
        }
        location ^~ /xe3/plugins/ {
                try_files $uri /xe3/index.php?$args;
        }
        location ^~ /xe3/storage/app/public/ {
                try_files $uri /xe3/index.php?$args;
        }
        location ~ ^/xe3/favicon* {
                try_files $uri /xe3/index.php?$args;
        }
        location /xe3/robots.txt {
                try_files $uri /xe3/index.php?$args;
        }

        location ~ \.php$ {
                rewrite ^.* /index.php;
        }
#####################################
 

게시글에 첨부파일을 넣으면 /xe3/storage/app/public/thumbnails/~~~ 가 아닌,

/storage/app/public/thumbnails/~~~ 로 경로가 잡혀 엑박이 뜨는 현상이 있습니다.

 

혹시 무엇이 문제인지 알려주실 수 있으십니까??

  • share