nginx 1.16.1 userdir 사용자 디렉토리 설정 > 질문답변

본문 바로가기
사이트 내 전체검색

질문답변

nginx 1.16.1 userdir 사용자 디렉토리 설정

페이지 정보

profile_image
작성자 미친새
댓글 0건 조회 19,765회 작성일 20-02-28 20:08

본문

vi default-ssl.conf 에 다가 아래것 추가한다.



    brotli on;
    brotli_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/octet-stream;

    gzip on;
    gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/octet-stream;

    expires max;


        # Userdir - php 여기서 부터 진짜
        location ~ ^/~([^/]+)/(.+\.php)$ {
            if (!-f /home/$1/public_html/$2) {
                rewrite ^ 404;
            }
            alias /home/$1/public_html/$2;
          # fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_pass  127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }

        # Userdir - static
        location ~ ^/~([^/]+)(/.*)?$ {
            alias /home/$1/public_html$2;
            index index.php index.html;
            autoindex on;
        }
      # 여기까지 추가 한다.


    location / {
    index  index.html index.htm index.php;
    try_files $uri $uri/ /index.php?$args;
    }

    include /etc/nginx/php.inc;


-유저디렉토리는 문구 넣는 위치가 상단에 있어야 한다 안그러면 404 에러.
-badgateway 에러 뜨면 fastcgi_pass  127.0.0.1:9000; 해주면 된다.

nginx restart 하는것 잊지마라.php-fpm restart  해는것도 좋고

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

사이트 정보

회사명 : 회사명 / 대표 : 대표자명
주소 : OO도 OO시 OO구 OO동 123-45
사업자 등록번호 : 123-45-67890
전화 : 02-123-4567 팩스 : 02-123-4568
통신판매업신고번호 : 제 OO구 - 123호
개인정보관리책임자 : 정보책임자명

공지사항

  • 게시물이 없습니다.

접속자집계

오늘
1,527
어제
2,368
최대
3,834
전체
846,980
Copyright © 소유하신 도메인. All rights reserved.