korindia.eond.com

접속됨

 

korindia.eond.com/xe-core 

접속됨

 

korindia.eond.com/xe

접속안됨

 

korindia.eond.com/xe/index.php

접속됨

 

왜 이런 걸까요?;;

접속이 되는 xe-core를 xe나 test 등으로 바꾸면 또 접속이 안됩니다.;;

  • profile
    접속안됨이 뭔가요? 404 오류? 403 오류?

    해당 server 블럭의 index 설정은 어떻게 되어 있나요?
    혹시 index 설정이 특정 location 블럭 안으로 들어가 있나요?
  • profile profile
    네, 404 Not Found 오류가 뜹니다.

    이상하게
    xe-core/xe-sub/xe-1
    이런 식으로
    xe- 으로 붙으면 정상적으로 뜨는데
    xe 만 적으면 접속이 안되고 404 오류가 뜹니다.

    nginx 설정 파일은 다음과 같이 작성하였습니다.

    server {
    listen 80;
    server_name korindia.eond.com;
    root /home1/korindia/www;

    # access_log /var/log/nginx/eond.com.access.log;
    # error_log /var/log/nginx/eond.com.error.log warn;
    # access_log /home/eond/log/access.log;
    error_log /home1/korindia/log/error.log crit;

    location / {
    index index.php index.html;
    }

    # Allow Lets Encrypt Domain Validation Program
    location ^~ /.well-known/acme-challenge/ {
    allow all;
    }

    # Block dot file (.htaccess .htpasswd .svn .git .env and so on.)
    location ~ /\. {
    deny all;
    }

    # Block (log file, binary, certificate, shell script, sql dump file) access.
    location ~* \.(log|binary|pem|enc|crt|conf|cnf|sql|sh|key)$ {
    deny all;
    }

    # Block access
    location ~* (composer\.json|contributing\.md|license\.txt|readme\.rst|readme\.md|readme\.txt|copyright|artisan|gulpfile\.js|package\.json|phpunit\.xml)$ {
    deny all;
    }

    location = /favicon.ico {
    log_not_found off;
    access_log off;
    }

    location = /robots.txt {
    log_not_found off;
    access_log off;
    }

    # Block .php file inside upload folder. uploads(wp), files(drupal, xe), data(gnuboard).
    location ~* /(?:uploads|data)/.*\.php$ {
    deny all;
    }

    # Add PHP handler
    location ~ [^/]\.(php|html|htm)(/|$) {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    if (!-f $document_root$fastcgi_script_name) {
    return 404;
    }

    fastcgi_read_timeout 150;
    fastcgi_pass unix:/run/php/korindia.sock;
    fastcgi_index index.php;
    include fastcgi_params;

    try_files $uri =404;

    }

    # mod_rewrite
    include /etc/nginx/xe_rewrite.conf;


    }
  • profile profile
    https://github.com/xpressengine/xe-core/wiki/Nginx-rewite-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0
    이것 설정 때문인거 같아요. 아무리 찾아봐도 안되길래 저 부분 빼니깐 되네요 ㅠ_ㅠ;;
    자세히는 저도 어느 부분 때문에 인덱스 파일을 못 찾은 건지는 ㅠ_ㅠ;
  • profile profile
    혹시 XE를 설치한 사이트 아래에 xe라는 폴더를 만들고 또다른 XE를 설치하셨나요?
    그런 형태라면 지원이 되지 않습니다.
    같은 레벨에 있는 두 개의 폴더에 각각 XE를 설치하는 것은 괜찮아요.
  • profile profile

    xe를 설치한 건 아니고, nginx 설정파일 만들 때 그냥 저 부분을 추가해넣어서 작성했습니다.
    그러다보니 다 동일한데,

    이번에는 xe를 루트가 아닌 서브디렉토리에 옮겨서 넣으려고 했는데
    그게 안되더라고요.

    xe를 설치 안하는 계정도 있어서 한줄씩 지워보면서 테스트해보니,

    rewrite ^/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last;

    이 부분 때문인 것 같았습니다.

    그리고 xe-core는 되는데, xe는 안됐던 게, 아마 저 부분이랑 연관이 있는 것 같고요

    ^/([a-zA-Z0-9_]+)/?$

    이 부분이 아마도, 
    계정/([a-zA-Z0-9_]+)/?$

     

    [a-zA-Z0-9_]

     

    이게 아마 정규식일 건데, 

    # mid link
    rewrite ^/shu/ /shu/index.html last;
    rewrite ^/xe/?$ /xe/index.php?mid=$1 last;
    rewrite ^/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last;
    #rewrite ^/xe/([a-zA-Z0-9_]+)/?$ /index.php?mid=$1 last;

    대충.. 이렇게 적어주니깐 되는 거 같아서 이렇게 할려고요 ㅠ_ㅠ;

    설치까지는 하고, 추가적인 건 사용하면서 아마 더 수정해야할 것 같습니다;ㅁ;

     

  • profile profile

    링크하신 XE rewrite 규칙은 XE를 서브디렉토리에 설치한 경우 작동하지 않습니다.
    수정하신 것처럼 해서 써도 짧은주소 이용에 문제가 많이 생길 거예요.

    라이믹스에서 제공하는 rewrite 규칙 중 서브디렉토리용으로 만들어진 것이 있으니
    여기서 디렉토리 이름만 /xe/로 바꿔서 쓰세요.

  • profile profile
    매번 감사합니다. 오늘 하루 종일 백번 넘게 수정하고 새로고침하고 해봤던 것 같습니다.
    덕분에 조금씩 알아갑니다. :)