nginx php설정

리눅스 공부 2014. 9. 29. 10:12

NGINX 설정

Nginx의 설정 파일을 수정한다.

설정파일은 아래의 위치 중의 하나에 있다.

  • /etc/nginx/conf.d/default.conf
  • /etc/nginx/sites-available/default

다음은 필자의 설정파일이다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
root /usr/share/nginx/html;
location / {
index index.html index.htm index.php;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

위의 내용을 그대로 사용하면 PHP 보안 문제가 있다. 아래 링크를 따라가면 몇가지 보안 이슈를 해결 할 수 있는 정보가 있다. 참고하자. http://phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=77007&page=#c_77013

출처~ http://opentutorials.org/module/384/4332

'리눅스 공부' 카테고리의 다른 글

mysql 기본 명령어  (0) 2014.09.29
mysql 비번설정  (0) 2014.09.29
포트 열기  (0) 2014.09.25
smb 삼바서버 설치  (0) 2014.09.25
소스파일 받는곳 gcc pcre zlib  (0) 2014.09.25
Posted by KyeomKim
,