nginx userdir 설정 > 질문답변

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

질문답변

nginx userdir 설정

페이지 정보

profile_image
작성자 미친새
댓글 0건 조회 19,251회 작성일 20-02-21 16:48

본문

server {
listen 80 default_server;
listen [::]:80 default_server;



root /var/www/html;

# Add index.php to the list if you are using PHP
index index.html index.php index.nginx-debian.html;

server_name _;


location ~* ^/~(.+?)(/.*\.php)$
{
alias /home/$1/public_html$2;
fastcgi_pass  unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}

location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/public_html$2;
index  index.html index.htm index.php;
autoindex on;
}


location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

#location ~ ^/~(?<user>[\w-]+)(?<path>/?.*)$ {
#    alias /home/$user/www$path;
#    autoindex on;
#}


# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
# listen 80;
# listen [::]:80;
#
# server_name example.com;
#
# root /var/www/example.com;
# index index.html;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}


설정 위치에가 상단에 와야 한다. 안그러면 404에러 발생

댓글목록

등록된 댓글이 없습니다.

회원로그인

회원가입

사이트 정보

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

공지사항

  • 게시물이 없습니다.

접속자집계

오늘
1,662
어제
2,003
최대
3,834
전체
849,118
Copyright © 소유하신 도메인. All rights reserved.