안녕하세요.
우분투 16.04.1 Nginx, MariaDB, PHP7.0 환경에서 XE를 설치할려고합니다.
php7.0-fpm 은 다 설치를 하였습니다.
Nginx 의 경로는 아래와같습니다.
/etc/nginx/conf.d <— 파일 없음 비어있음
/etc/nginx/sites-enabled/ default 파일 링크 되어있음
/etc/nginx/sites-available/
기본 html 경로는 아래와 같습니다.
/var/www/html/
nginx 환경 설정 값을 알고싶습니다.
xe를 /var/www/html/xe로 하고
phpmyadmin 을
/var/www/html/phpmyadmin
경로로 하고 싶습니다.
웹브라우져에서 아래와 같이 입력했을때 정상적으로 작동되었으면 좋겠습니다.
/127.0.0.1/xe
/127.0.0.1/phpmyadmin
nginx 설정 값을 알고싶습니다.
sites-enabled/ <— 여기 설정될 default 파일의 내용이 어떻게 되는지 궁금합니다.
conf.d 폴더에는 아무것도 없던데 sites-enabled 폴더안에 설정 파일을 넣으면 conf.d 에는 아무런
설정 파일이 따로 필요 없는지 궁금합니다.
감사합니다. ^^
root /var/www/html/;
index index.php index.html index.htm;
include xe.conf; #nginx rewrite/경로에 따라 적는방법다름 전 최상위에둠
server_name 127.0.0.1;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html/;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
이정도려나요..
뭐 핫링크 방지나 캐시파일 기능 넣고싶으면
location ~* \.(css|js|gif|jpe?g|png|bmp|ico|svg)$ {
valid_referers none blocked server_names;
if ($invalid_referer) {return 403;}
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
이것도 추가해주시면되구요