와일드 카드 DNS 항목이 있으므로 * .mydomain.tld가 내 서버로 연결됩니다. 내가 nginx를 를 사용하고 나는 2 개의 conf 파일 제목이 :nginx catchall conf 파일이 모두 catch하지 않습니다
- 기본
- myconf.conf
내 conf의 파일는 다음과 같이 :
기본 :
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
root /var/www/website;
index index.html index.htm;
server_name _;
location/{
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
}
}
myconf.conf :
server {
listen 80;
#listen [::]:80 default_server ipv6only=on;
root /home/me/www/website;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
# orig # server_name localhost;
server_name me.mydomain.tld;
access_log /home/me/logs/me.mydomain.tld.access.log;
error_log /home/me/logs/me.mydomain.tld.error.log warn;
location/{
try_files $uri $uri/ $uri.php?$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
다음과 같이 도메인을 탐색 할 때로드되는 conf 파일입니다.
- me.mydomain.tld로드 최대 루트 디렉토리 myconf.conf에 정의
- mydomain.tld로드 업 루트 디렉토리는 기본적으로 정의
- anything.mydomain.tld로드 최대 루트 디렉토리를 myconf.conf에 정의
기본값이 잘못되었습니다. anything.mydomain.tld는 기본 conf 파일의 루트 디렉토리를로드해야합니다.